798 Commits

Author SHA1 Message Date
Jordan Harband
7f5a65832d [eslint config] [minor] enable react/state-in-constructor 2019-08-09 23:52:29 -07:00
Jordan Harband
25075b5f72 [eslint config] [minor] enable react/jsx-curly-newline 2019-08-09 23:50:40 -07:00
Jordan Harband
a23f93eb00 [eslint config] [breaking] enable react/jsx-fragments 2019-08-09 23:48:45 -07:00
Jordan Harband
b447768ad3 [eslint config] [deps] update eslint-config-airbnb-base, eslint-plugin-react 2019-08-09 23:48:11 -07:00
Jordan Harband
b05573cae4 [eslint config] [base] v14.0.0 2019-08-09 23:41:02 -07:00
Jordan Harband
e6f591f660 [Dev Deps] update babel-related deps to latest 2019-08-09 23:22:48 -07:00
Jordan Harband
282ef9ea90 [eslint config] [base] [breaking] no-self-assign: enable props option 2019-08-09 22:46:22 -07:00
Jordan Harband
d490ee1806 [eslint config] [base] [breaking] enable no-useless-catch 2019-08-09 22:45:49 -07:00
Jordan Harband
08f8093ed1 [eslint config] [base] [breaking] enable max-classes-per-file 2019-08-09 22:45:27 -07:00
Jordan Harband
d03a712bba [eslint config] [base] [breaking] enable no-misleading-character-class 2019-08-09 22:44:01 -07:00
Jordan Harband
f0c767fd39 [eslint config] [base] [breaking] enable no-async-promise-executor 2019-08-09 22:43:20 -07:00
Jordan Harband
88e71e6e52 [eslint config] [base] [breaking] enable prefer-object-spread 2019-08-09 22:42:20 -07:00
Jordan Harband
11ede40d55 [eslint config] [base] [breaking] func-name-matching: enable considerPropertyDescriptor option 2019-08-09 22:41:33 -07:00
Jordan Harband
e257deebd4 [eslint config] [base] [patch] camelcase: enable ignoreDestructuring 2019-08-09 22:40:53 -07:00
Jordan Harband
6b5922ca21 [eslint config] [breaking] set react version to "detect"
Fixes #1983.
2019-08-09 22:39:06 -07:00
Jeff VanDyke
bb011c2f2f [eslint config] [base] [patch] Add markers to spaced-comment block for Flow types
See <https://flow.org/en/docs/types/comments/>
2018-11-29 09:13:54 -05:00
Vladimir Kutepov
8148bfce3c [eslint config] [base] [patch] Do not prefer destructuring for object assignment expression
```js
let param = 'default value';

if (object)
  param = object.param; // <= prefer-destructuring
}

// ...
```
I think that `param = object.param;` is better than `({ param } = object);` because it is easier to read and tedious to write brackets by hand.

MDN: [Destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
2017-10-10 18:21:50 +03:00
amanjain
19e9ce31fe [eslint config] [base] [breaking] padded-blocks: enable allowSingleLineBlocks option 2017-01-12 12:15:39 +05:30
Felipe Pinheiro
61c7ae6189 [eslint config] Add missing/unsafe lifecycle methods to react/sort-comp rule 2019-06-17 12:58:54 -03:00
Rahil Vora
8c686eac4b [eslint config] add componentDidCatch to lifecycle for react/sort-comp 2019-07-22 11:27:02 -05:00
JBallin
a344d6c8e7 [guide] [eslint config] [base] [breaking] no-multiple-empty-lines: Restrict empty lines at beginning of file 2019-06-10 13:49:58 -07:00
Waseem Dahman
2160a77baa [eslint config] [breaking] [react] add react-hooks plugin 2019-03-12 23:36:07 -04:00
Ed Morley
ad0c44c6af [eslint config] Remove rules/strict from 'extends'
Since the file is now imported in base instead.

Fixes #1582.
2018-11-20 12:06:34 +00:00
Ed Morley
42c647f31b [eslint config] [base] [breaking] Set 'strict' to 'never'
Previously `rules/strict.js` was only used by `eslint-config-airbnb`
and not base. This change reduces the duplication, and means the rule
is now set to 'never' as opposed to the ESLint default of 'safe'.

For users that left the `sourceType` at this preset's default of
`module` this change will be a no-op, since in module-mode the
`strict` rule always behaves as though 'never' had been set.

See:
https://eslint.org/docs/rules/strict#options
2018-11-20 12:04:17 +00:00
Ed Morley
b96341fb86 [eslint config] [base] [breaking] legacy: Enable 'strict'
This enables the `strict` rule in 'safe' mode:
https://eslint.org/docs/rules/strict#safe
2018-11-20 11:55:50 +00:00
Sharmila
f6acb789a0 [guide] [eslint config] [base] [breaking] Simplifies no-mixed-operators
- adds warning on mixing `/` and `*` arithmetic operators
- removes warnings on mixing `**` and arithmetic operators
- removes warning on mixing `in` and `instanceof`
- removes warning on mixing `~` with other bitwise operators
- removes mixing of assignment operators with comparison operators
2018-07-10 15:19:05 -07:00
Sharmila
820745d610 [guide] [eslint config] [base] [breaking] Require parens for arrow function args 2018-07-09 18:14:32 -07:00
Jordan Harband
8eacf24310 [eslint config] [*] [breaking] add eslint v6, drop eslint v4
See #2036
2019-08-09 14:18:55 -07:00
Jordan Harband
3b18fea1ed [Tests] only run tests in non-lint per-package travis job 2019-08-09 14:20:40 -07:00
Jordan Harband
820ccf7652 [eslint config] [*] [tests] use eclint instead of editorconfig-tools 2019-08-09 14:06:58 -07:00
Jordan Harband
792bb567e5 [eslint config] [*] update eslint-find-rules, eslint-plugin-import 2019-08-09 14:04:36 -07:00
Jordan Harband
6a50516df7 [eslint config] [meta] add disabled config for new react and a11y rules 2019-07-01 17:07:38 -07:00
Jordan Harband
21493ad7e9 [eslint config] [base] [deps] update confusing-browser-globals, eslint-plugin-import, tape, babel-preset-airbnb 2019-07-01 16:26:52 -07:00
Jordan Harband
873f302b00 [eslint config] v17.1.1 2019-07-01 16:17:49 -07:00
Jordan Harband
7ea44cfc79 [eslint config] [deps] update eslint-config-airbnb-base, eslint-plugin-import, eslint-plugin-react, eslint-plugin-jsx-a11y, babel-preset-airbnb, tape 2019-07-01 16:12:08 -07:00
Jordan Harband
9fbe07f282 [eslint-config] [base] v13.2.0 2019-07-01 15:05:02 -07:00
Christian Oliff
76ff7c7f79 [editorial] [docs] correct JavaScript capitalization 2019-06-24 22:45:35 +09:00
Joseph Nields
1310ade9d0 [eslint config] [base] [patch] Ignore property modifications of staticContext params
React Router passes a `staticContext` property to children to allow
signalling status codes and redirected URLs, by allowing children to
assign property values to it during render
2019-04-27 14:00:50 -07:00
Jordan Harband
5cd011dfa1 [eslint config] [base] [deps] update eslint-plugin-import 2019-04-27 23:51:44 -07:00
Jordan Harband
117d4fce49 [Tests] fix issue with eslint dev deps 2019-04-27 23:27:07 -07:00
Jordan Harband
b85baeafed [eslint config] [base] [meta] add disabled prefer-named-capture-group rule 2019-03-03 23:23:14 -08:00
Jordan Harband
a71c2d1ad3 [eslint config] add disabled jsx-fragments rule 2019-02-17 14:20:53 -08:00
Jordan Harband
834d717c7b [eslint config] [*] [deps] update eslint-plugin-import, eslint-plugin-jsx-a11y, tape 2019-02-17 14:16:48 -08:00
Jamie
8694a87378 [eslint config] [react] [patch] Turn off react/no-multi-comp
Splitting up a component into multiple components can be useful for many reasons, including making important performance optimizations.

This lint rule discourages splitting up components because it forces you to: create a new file, copy over all the relevant imports, move over any local functions/values (or move them into yet another shared module), export the component (which makes your split off component now a public export), and re-import it into the new module.

Having multiple components per file shouldn't be much different from having multiple functions per file. And you shouldn't be forced to make a component a public export if it's really just an internal implementation detail of another component.

There's an argument to be made about _exporting_ multiple components, but mostly just in the context of React.lazy because it can only import default exports and you don't want something else in that file being statically imported (because that will prevent it from being code-split).
2019-02-14 11:57:20 -08:00
Pier-Luc Brault
4f15da6146 [eslint config] [*] [readme] Improve eslint config setup instructions for yarn 2019-02-07 11:48:32 -05:00
tclindner
96f95fa35e [eslint config] [base] [patch] no-extraneous-dependencies: Add jest.setup.js to devDeps 2019-01-29 21:58:23 -06:00
Jordan Harband
25f11fb31e [eslint config] [patch] extend no-underscore-dangle to allow for redux dev tools in the main config instead 2019-01-26 10:12:49 -08:00
Remco Haszing
b6c56cb070 [eslint config] [base] [patch] Allow use of __REDUX_DEVTOOLS_EXTENSION_COMPOSE__
This style guide disallows the use of underscores in properties. However, the
Redux browser extension requires the use of a variable named
`__REDUX_DEVTOOLS_EXTENSION_COMPOSE__`. Since Redux is so popular with React,
it makes sense to allow this.
2019-01-21 13:39:53 +01:00
Jordan Harband
d8256fc886 [eslint config] [*] [deps] update object.entries, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react 2019-01-27 13:41:14 -08:00
Jordan Harband
387755e8fe [meta] add disabled no-useless-catch config 2018-12-28 14:31:03 -08:00