@@ -6,27 +6,22 @@ const config = {
66 parserOptions : { } ,
77 extends : [
88 // /!\ Order matters: the next one overrides rules from the previous one
9- 'plugin:unicorn/recommended' ,
109 'plugin:jest/recommended' ,
10+ 'plugin:unicorn/recommended' ,
1111 'airbnb' ,
1212 // Already done by Airbnb
1313 //'plugin:react/recommended'
1414 'plugin:@typescript-eslint/recommended' ,
15- 'plugin:prettier/recommended' ,
16- 'prettier/@typescript-eslint' ,
17- 'prettier/react'
15+ 'plugin:prettier/recommended'
1816 ] ,
1917 plugins : [ 'simple-import-sort' , 'react-hooks' ] ,
2018 env : {
2119 browser : true
2220 } ,
23- globals : {
24- // Jest Puppeteer, see https://github.com/smooth-code/jest-puppeteer/blob/v4.0.0/README.md#configure-eslint
25- page : true
26- } ,
21+ globals : { } ,
2722
2823 rules : {
29- 'no-console' : 'off' ,
24+ 'no-console' : [ 'error' , { allow : [ 'error' , 'info' ] } ] ,
3025 'no-alert' : 'off' ,
3126 'no-underscore-dangle' : 'off' ,
3227 'no-plusplus' : 'off' ,
@@ -46,10 +41,10 @@ const config = {
4641 'import/prefer-default-export' : 'off' ,
4742 'import/extensions' : 'off' ,
4843
49- 'simple-import-sort/sort ' : [
44+ 'simple-import-sort/imports ' : [
5045 'error' ,
5146 {
52- // https://github.com/lydell/eslint-plugin-simple-import-sort/blob/v5 .0.2 /src/sort .js#L3-L15
47+ // https://github.com/lydell/eslint-plugin-simple-import-sort/blob/v7 .0.0 /src/imports .js#L5
5348 groups : [
5449 // Side effect imports
5550 [ '^\\u0000' ] ,
@@ -63,8 +58,8 @@ const config = {
6358 ] ,
6459
6560 // Absolute imports and other imports such as Vue-style `@/foo`
66- // Anything that does not start with a dot
67- [ '^[^.] ' ] ,
61+ // Anything not matched in another group
62+ [ '^' ] ,
6863
6964 // Relative imports
7065 [
@@ -86,6 +81,7 @@ const config = {
8681 ]
8782 }
8883 ] ,
84+ 'simple-import-sort/exports' : 'error' ,
8985
9086 // https://github.com/typescript-eslint/typescript-eslint/blob/v4.1.0/packages/eslint-plugin/docs/rules/no-use-before-define.md
9187 'no-use-before-define' : 'off' ,
@@ -119,21 +115,38 @@ const config = {
119115 // [IE does not support for...of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of#Browser_compatibility)
120116 'unicorn/no-for-loop' : 'off' ,
121117 'unicorn/no-null' : 'off' ,
118+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v27.0.0/docs/rules/no-array-for-each.md
119+ // https://github.com/github/eslint-plugin-github/blob/v4.1.1/docs/rules/array-foreach.md
120+ // conflicts with
121+ // https://github.com/airbnb/javascript/issues/1271
122+ 'unicorn/no-array-for-each' : 'off' ,
123+ // FIXME Activate when ES modules are well supported
124+ 'unicorn/prefer-module' : 'off' ,
122125 'unicorn/prefer-query-selector' : 'off' ,
126+ 'unicorn/numeric-separators-style' : 'off' ,
127+ 'unicorn/no-await-expression-member' : 'off' ,
123128
124129 'jsx-a11y/label-has-associated-control' : 'off' ,
125130
126131 'react/no-unescaped-entities' : 'off' ,
127132 'react/jsx-filename-extension' : [ 'error' , { extensions : [ '.tsx' , '.jsx' ] } ] ,
133+ 'react/jsx-uses-react' : 'off' ,
134+ 'react/react-in-jsx-scope' : 'off' ,
135+ // FIXME https://github.com/yannickcr/eslint-plugin-react/issues/3114#issuecomment-951725512
136+ 'react/jsx-no-bind' : 'off' ,
128137 'react/jsx-pascal-case' : 'off' ,
129138 'react/jsx-props-no-spreading' : 'off' ,
130139 'react/static-property-placement' : 'off' ,
131140 'react/state-in-constructor' : 'off' ,
141+ 'react/no-unused-class-component-methods' : 'off' ,
142+ 'react/no-unstable-nested-components' : 'off' ,
143+ 'react/require-default-props' : 'off' ,
144+ 'react/default-props-match-prop-types' : 'off' ,
145+ 'react/no-unused-prop-types' : 'off' ,
132146
133147 'react-hooks/rules-of-hooks' : 'error' ,
134148 'react-hooks/exhaustive-deps' : 'error' ,
135149
136- 'jest/no-expect-resolves' : 'error' ,
137150 'jest/expect-expect' : 'off'
138151 } ,
139152
@@ -154,8 +167,10 @@ const config = {
154167 }
155168 } ,
156169 {
157- files : [ '*.test.tsx' ] ,
170+ files : [ '*.test.ts' , '*.test. tsx'] ,
158171 rules : {
172+ 'unicorn/consistent-function-scoping' : 'off' ,
173+
159174 'jsx-a11y/iframe-has-title' : 'off'
160175 }
161176 }
0 commit comments