Mark Stacey
7d0a7ab301
Update `@metamask/eslint-config` to v4.1.0 ( #9663 )
...
`@metamask/eslint-config` has been updated to v4.1.0. This update
requires that we update `eslint` to v7 as well, which in turn requires
updating most `eslint`-related packages.
Most notably, `babel-eslint` was replaced with `@babel/eslint-parser`,
and `babel-eslint-plugin` was replaced by `@babel/eslint-plugin`. This
required renaming all the `babel/*` rules to `@babel/*`.
Most new or updated rules that resulted in lint errors have been
temporarily disabled. They will be fixed and re-enabled in subsequent
PRs.
4 years ago
Mark Stacey
ce66ddcf0d
Use `prettier` for JSON linting ( #9396 )
...
Instead of using `eslint-plugin-json` for linting JSON files,
`prettier` is now used. `prettier` is capable of detecting and
correcting more problems than `eslint-plugin-json` can, such as
indentation.
All JSON files have been run through `prettier`. The changes are all
superficial.
4 years ago
Whymarrh Whitby
b8938c9c7a
Move ESLint ignore patterns into config ( #9392 )
4 years ago
Whymarrh Whitby
449118dfc9
Remove unneeded globals from ESLint config ( #9342 )
4 years ago
Whymarrh Whitby
1024f49275
Use @metamask/eslint-config@3.2.0 ( #9330 )
4 years ago
Whymarrh Whitby
2b7a692658
Use @metamask/eslint-config@3.1.0 ( #9275 )
...
This change updates the shared ESLint config to the latest published version,
v3.1.0.
From the config [`CHANGELOG.md`][1]: v3.0.1 has disabled `prefer-object-spread`
by default, so it has been enabled for this project.
[1]:https://github.com/MetaMask/eslint-config/blob/master/CHANGELOG.md
4 years ago
Whymarrh Whitby
b6ccd22d6c
Update ESLint shared config to v3 ( #9274 )
...
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
4 years ago
Whymarrh Whitby
6ab12001e3
Fix prefer-destructuring issues ( #9263 )
...
See [`prefer-destructuring`](https://eslint.org/docs/rules/prefer-destructuring ) for more information.
This change enables `prefer-destructuring` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
c1e3c229bc
Fix import/order issues ( #9239 )
...
See [`import/order`](https://eslint.org/docs/rules/import/order ) for more information.
This change enables `import/order` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
b7259e5d6a
Fix radix issues ( #9247 )
...
See [`radix`](https://eslint.org/docs/rules/radix ) for more information.
This change enables `radix` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
4357cda7b8
Fix no-shadow issues ( #9246 )
...
See [`no-shadow`](https://eslint.org/docs/rules/no-shadow ) for more information.
This change enables `no-shadow` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
a89b6677a1
Fix import/unambiguous issues ( #9233 )
...
See [`import/unambiguous`](https://eslint.org/docs/rules/import/unambiguous ) for more information.
This change enables `import/unambiguous` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
e803807dd9
Fix no-param-reassign issues ( #9235 )
...
See [`no-param-reassign`](https://eslint.org/docs/rules/no-param-reassign ) for more information.
This change enables `no-param-reassign` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
aaacf66c6e
Fix import/no-extraneous-dependencies issues ( #9232 )
...
See [`import/no-extraneous-dependencies`](https://eslint.org/docs/rules/import/no-extraneous-dependencies ) for more information.
This change enables `import/no-extraneous-dependencies` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
e021acdc0a
Fix max-statements-per-line issues ( #9218 )
...
See [`max-statements-per-line`](https://eslint.org/docs/rules/max-statements-per-line ) for more information.
This change enables `max-statements-per-line` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
9e7841fa91
Consolidate ESLint config files ( #9231 )
4 years ago
Whymarrh Whitby
5d42a9b773
Fix require-unicode-regexp issues ( #9212 )
...
* Fix require-unicode-regexp issues
See [`require-unicode-regexp`](https://eslint.org/docs/rules/require-unicode-regexp ) for more information.
This change enables `require-unicode-regexp` and fixes the issues raised by the rule.
* Remove case-insensitive flag from regexps
4 years ago
Whymarrh Whitby
884775cf71
Fix no-negated-condition issues ( #9222 )
...
See [`no-negated-condition`](https://eslint.org/docs/rules/no-negated-condition ) for more information.
This change enables `no-negated-condition` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
c11888f287
Fix no-empty-function issues ( #9216 )
...
See [`no-empty-function`](https://eslint.org/docs/rules/no-empty-function ) for more information.
This change enables `no-empty-function` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
9b78d3ab07
Fix import/extensions issues ( #9217 )
...
See [`import/extensions`](https://eslint.org/docs/rules/import/extensions ) for more information.
This change enables `import/extensions` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
3bd22a2058
Fix no-template-curly-in-string issues ( #9221 )
...
See [`no-template-curly-in-string`](https://eslint.org/docs/rules/no-template-curly-in-string ) for more information.
This change enables `no-template-curly-in-string` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
944f6d4880
Fix no-process-exit issues ( #9219 )
...
See [`no-process-exit`](https://eslint.org/docs/rules/no-process-exit ) for more information.
This change enables `no-process-exit` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
82a0ee27f3
Fix prefer-rest-params issues ( #9215 )
...
See [`prefer-rest-params`](https://eslint.org/docs/rules/prefer-rest-params ) for more information.
This change enables `prefer-rest-params` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
146127c474
Fix no-prototype-builtins issues ( #9213 )
...
See [`no-prototype-builtins`](https://eslint.org/docs/rules/no-prototype-builtins ) for more information.
This change enables `no-prototype-builtins` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
b91cf74d14
Fix no-nested-ternary issues ( #9214 )
...
See [`no-nested-ternary`](https://eslint.org/docs/rules/no-nested-ternary ) for more information.
This change enables `no-nested-ternary` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
954df6e482
Fix no-constant-condition issues ( #9210 )
...
See [`no-constant-condition`](https://eslint.org/docs/rules/no-constant-condition ) for more information.
This change enables `no-constant-condition` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
42e7d205b2
Fix no-dupe-else-if issues ( #9208 )
...
See [`no-dupe-else-if`](https://eslint.org/docs/rules/no-dupe-else-if ) for more information.
This change enables `no-dupe-else-if` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
853b89e314
Fix no-global-assign issues ( #9209 )
...
See [`no-global-assign`](https://eslint.org/docs/rules/no-global-assign ) for more information.
This change enables `no-global-assign` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
cd370be728
Fix no-invalid-this issues ( #9207 )
...
See [`no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this ) for more information.
This change enables `no-invalid-this` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
c0f05ccae6
Fix implicit-arrow-linebreak issues ( #9201 )
...
See [`implicit-arrow-linebreak`](https://eslint.org/docs/rules/implicit-arrow-linebreak ) for more information.
This change enables `implicit-arrow-linebreak` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
76bd7f98b6
Fix prefer-spread issues ( #9203 )
...
See [`prefer-spread`](https://eslint.org/docs/rules/prefer-spread ) for more information.
This change enables `prefer-spread` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
310b15ba4a
Fix no-plusplus issues ( #9206 )
...
See [`no-plusplus`](https://eslint.org/docs/rules/no-plusplus ) for more information.
This change enables `no-plusplus` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
548b0bbbd5
Fix no-eq-null issues ( #9205 )
...
See [`no-eq-null`](https://eslint.org/docs/rules/no-eq-null ) for more information.
This change enables `no-eq-null` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
88f54e29fb
Fix no-empty issues ( #9202 )
...
See [`no-empty`](https://eslint.org/docs/rules/no-empty ) for more information.
This change enables `no-empty` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
3346c2fc07
Fix no-loop-func issues ( #9199 )
...
See [`no-loop-func`](https://eslint.org/docs/rules/no-loop-func ) for more information.
This change enables `no-loop-func` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
ef88d79fac
Fix no-useless-concat issues ( #9200 )
...
See [`no-useless-concat`](https://eslint.org/docs/rules/no-useless-concat ) for more information.
This change enables `no-useless-concat` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
9842b2f1ce
Fix no-useless-catch issues ( #9198 )
...
See [`no-useless-catch`](https://eslint.org/docs/rules/no-useless-catch ) for more information.
This change enables `no-useless-catch` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
a8863a3446
Fix consistent-return issues ( #9192 )
...
See [`consistent-return`](https://eslint.org/docs/rules/consistent-return ) for more information.
This change enables `consistent-return` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
885125ad03
Fix no-case-declarations issues ( #9191 )
...
See [`no-case-declarations`](https://eslint.org/docs/rules/no-case-declarations ) for more information.
This change enables `no-case-declarations` and fixes the issues raised by the rule.
4 years ago
Whymarrh Whitby
bf6578c6b8
Enable guard-for-in rule ( #9000 )
4 years ago
Whymarrh Whitby
50c4db73cf
Fix global-require issues ( #8999 )
4 years ago
Whymarrh Whitby
68a64af5b3
Fix callback-return issues ( #8996 )
...
See [`callback-return`](https://eslint.org/docs/rules/callback-return ) for more information.
This change enables `callback-return` and fixes the resulting issues.
4 years ago
Whymarrh Whitby
983e32274c
Fix array-callback-return issues
...
See [`array-callback-return`](https://eslint.org/docs/rules/array-callback-return ) for more information.
This change enables `array-callback-return` and fixes the issues raised by the
rule.
4 years ago
Brad Decker
13d6803698
Adds the rule of hooks eslint rule ( #8779 )
5 years ago
Whymarrh Whitby
e4b8cddf02
Disallow all anonymous default export, aside from CSF and migrations ( #8535 )
...
CSF = Storybook’s Component Story Format (CSF)
See https://storybook.js.org/docs/formats/component-story-format/
Note that the migrations still use CommonJS require, so the default export as
an object is quite ergonomic (& I don't want to touch the migrations).
5 years ago
Whymarrh Whitby
c7f866c06f
Add no-tabs ESLint rule ( #8518 )
5 years ago
Mark Stacey
5ee1291662
Prevent accidental use of globals ( #8340 )
...
Previously all browser globals were allowed to be used anywhere by
ESLint because we had set the `env` property to `browser` in the ESLint
config. This has made it easy to accidentally use browser globals
(e.g. #8338 ), so it has been removed. Instead we now have a short list
of allowed globals.
All browser globals are now accessed as properties on `window`.
Unfortunately this change resulted in a few different confusing unit
test errors, as some of our unit tests setup assumed that a particular
global would be used via `window` or `global`. In particular,
`window.fetch` didn't work correctly because it wasn't patched by the
AbortController polyfill (only `global.fetch` was being patched).
The `jsdom-global` package we were using complicated matters by setting
all of the JSDOM `window` properties directly on `global`, overwriting
the `AbortController` for example.
The `helpers.js` test setup module has been simplified somewhat by
removing `jsdom-global` and constructing the JSDOM instance manually.
The JSDOM window is set on `window`, and a few properties are set on
`global` as well as needed by various dependencies. `node-fetch` and
the AbortController polyfill/patch now work as expected as well,
though `fetch` is only available on `window` now.
5 years ago
Whymarrh Whitby
6b6615be27
Enable react/jsx-first-prop-new-line for multiline, single prop JSX ( #8276 )
...
* Enable react/jsx-first-prop-new-line for multiline, single prop JSX
* yarn lint --fix
5 years ago
Whymarrh Whitby
81d8237654
Use eslint-plugin-react@7.18.3 ( #8085 )
5 years ago
Whymarrh Whitby
ef8ea9b188
Remove eslint-plugin-chai ( #8089 )
5 years ago