eslint-config-moneyforward 4.1.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -105,16 +105,16 @@ We also provide various other rule sets that you can configure to suit your proj
105
105
  }
106
106
  ```
107
107
 
108
- | Rule set | Summary | Dependencies |
109
- | -----------: | :---------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
110
- | `essentials` | Contains basic, import, and promise recommended rules | [`eslint`](https://eslint.org/) <br> [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise) <br> [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import) |
111
- | `jsdoc` | Contains JSDoc recommended rules | [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) |
112
- | `next` | Contains Next.js recommended rules | [`@next/eslint-plugin-next`](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
113
- | `node` | Contains Node.js recommended rules | [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n) |
114
- | `react` | Contains React recommended rules | [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) <br> [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) <br> [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react) |
115
- | `storybook` | Contains Storybook recommended rules | [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook) |
116
- | `test/react` | Contains Jest and React Testing Library rules | [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest) <br> [`eslint-plugin-jest-dom`](https://github.com/testing-library/eslint-plugin-jest-dom) <br> [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) |
117
- | `typescript` | Contains TypeScript recommended rules | [`@eslint-typescript/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin) <br> [`@eslint-typescript/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) |
108
+ | Rule set | Summary | Dependencies |
109
+ | -----------: | :---------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
110
+ | `essentials` | Contains basic, import, and promise recommended rules | [`eslint`](https://eslint.org/) <br> [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise) <br> [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import) <br> [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn) |
111
+ | `jsdoc` | Contains JSDoc recommended rules | [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) |
112
+ | `next` | Contains Next.js recommended rules | [`@next/eslint-plugin-next`](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
113
+ | `node` | Contains Node.js recommended rules | [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n) |
114
+ | `react` | Contains React recommended rules | [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) <br> [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) <br> [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react) |
115
+ | `storybook` | Contains Storybook recommended rules | [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook) |
116
+ | `test/react` | Contains Jest and React Testing Library rules | [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest) <br> [`eslint-plugin-jest-dom`](https://github.com/testing-library/eslint-plugin-jest-dom) <br> [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) |
117
+ | `typescript` | Contains TypeScript recommended rules | [`@eslint-typescript/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin) <br> [`@eslint-typescript/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) |
118
118
 
119
119
  ## Using Prettier
120
120
 
@@ -162,7 +162,7 @@ By adding the `prettier` configuration to `extends` in the ESLint configuration,
162
162
  eslint-config-moneyforward contains various plugins related to different rule sets. Therefore, users don't need to install them separately. If you have installed them in your existing configuration, we recommend uninstalling them.
163
163
 
164
164
  ```bash
165
- npm uninstall eslint-plugin-promise eslint-plugin-import \
165
+ npm uninstall eslint-plugin-promise eslint-plugin-import eslint-plugin-unicorn \
166
166
  eslint-plugin-jsdoc \
167
167
  @next/eslint-plugin-next \
168
168
  eslint-plugin-n \
@@ -178,6 +178,10 @@ npm uninstall eslint-plugin-promise eslint-plugin-import \
178
178
  - Increment minor version: Changed **warn** rules.
179
179
  - Increment patch version: Not changed **error** and **warn** rules.
180
180
 
181
+ ## Troubleshooting
182
+
183
+ - [ESLint Configuration Issue with Non-Standard TSConfig Filenames in Flat Config](https://github.com/moneyforward/eslint-config-moneyforward/blob/main/docs/troubleshooting/eslint-configuration-issue-with-non-standard-tsconfig-filenames-in-flat-config.md)
184
+
181
185
  ## License
182
186
 
183
- Open source [licensed as MIT](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/LICENSE).
187
+ Open source [licensed as MIT](https://github.com/moneyforward/eslint-config-moneyforward/blob/main/LICENSE).
@@ -6,6 +6,7 @@ module.exports = {
6
6
  '../../rules/imports',
7
7
  '../../rules/promise',
8
8
  '../../rules/style',
9
+ '../../rules/unicorn',
9
10
  '../../rules/variables',
10
11
  ],
11
12
  parserOptions: {
@@ -3,12 +3,14 @@ import globals from 'globals';
3
3
  // @ts-ignore
4
4
  import importPlugin from 'eslint-plugin-import';
5
5
  import promisePlugin from 'eslint-plugin-promise';
6
+ import unicornPlugin from 'eslint-plugin-unicorn';
6
7
  import bestPracticesRuleSet from '../../rules/best-practices.js';
7
8
  import errorsRuleSet from '../../rules/errors.js';
8
9
  import es6RuleSet from '../../rules/es6.js';
9
10
  import importRuleSetBase from '../../rules/imports.js';
10
11
  import promiseRuleSetBase from '../../rules/promise.js';
11
12
  import styleRuleSet from '../../rules/style.js';
13
+ import unicornRuleSetBase from '../../rules/unicorn.js';
12
14
  import variablesRuleSet from '../../rules/variables.js';
13
15
 
14
16
  const importRuleSet = {
@@ -33,6 +35,25 @@ const promiseRuleSet = {
33
35
  },
34
36
  };
35
37
 
38
+ const unicornRuleSet = {
39
+ plugins: {
40
+ unicorn: unicornPlugin,
41
+ },
42
+ rules: {
43
+ ...unicornPlugin.configs['flat/recommended'].rules,
44
+ ...unicornRuleSetBase.rules,
45
+ },
46
+ };
47
+
48
+ const unicornRuleSetForReact = {
49
+ plugins: {
50
+ unicorn: unicornPlugin,
51
+ },
52
+ rules: {
53
+ ...unicornRuleSetBase.overrides[0].rules,
54
+ },
55
+ };
56
+
36
57
  export default [
37
58
  {
38
59
  languageOptions: {
@@ -51,4 +72,10 @@ export default [
51
72
  promiseRuleSet,
52
73
  styleRuleSet,
53
74
  variablesRuleSet,
75
+
76
+ unicornRuleSet,
77
+ {
78
+ files: ['*.@(jsx|tsx)'],
79
+ ...unicornRuleSetForReact,
80
+ },
54
81
  ];
@@ -1,15 +1,15 @@
1
1
  // @ts-check
2
- import essentials from './essentials.mjs';
3
- import jsdoc from './jsdoc.mjs';
4
- import next from './next.mjs';
5
- import node from './node.mjs';
6
- import react from './react.mjs';
7
- import storybook from './storybook.mjs';
8
2
  import testReact from './test/react.mjs';
9
- import typescript from './typescript.mjs';
10
3
 
11
4
  const test = {
12
5
  react: testReact,
13
6
  };
14
7
 
15
- export { essentials, jsdoc, next, node, react, storybook, test, typescript };
8
+ export { default as essentials } from './essentials.mjs';
9
+ export { default as jsdoc } from './jsdoc.mjs';
10
+ export { default as next } from './next.mjs';
11
+ export { default as node } from './node.mjs';
12
+ export { default as react } from './react.mjs';
13
+ export { default as storybook } from './storybook.mjs';
14
+ export { default as typescript } from './typescript.mjs';
15
+ export { test };
@@ -1,42 +1,23 @@
1
1
  // @ts-check
2
2
  // @ts-ignore
3
3
  import importPlugin from 'eslint-plugin-import';
4
- import * as storybook from 'eslint-plugin-storybook';
5
- import storybookRuleSetBase from '../../rules/storybook.js';
6
-
7
- const storybookRuleSetStories = {
8
- plugins: {
9
- storybook,
10
- import: importPlugin,
11
- },
12
-
13
- rules: {
14
- ...storybook.configs.recommended.overrides[0].rules,
15
- ...storybook.configs['csf-strict'].rules,
16
- ...storybookRuleSetBase.rules,
17
- 'import/no-default-export': ['off'],
18
- },
19
- };
20
-
21
- const storybookRuleSetConfig = {
22
- plugins: {
23
- storybook,
24
- import: importPlugin,
25
- },
26
- rules: {
27
- ...storybook.configs.recommended.overrides[1].rules,
28
- 'import/no-default-export': ['off'],
29
- },
30
- };
4
+ import storybook from 'eslint-plugin-storybook';
31
5
 
32
6
  export default [
33
7
  {
34
- files: ['**/*.@(stories|story).@(ts|tsx|js|jsx|mjs|cjs)'],
35
- ...storybookRuleSetStories,
8
+ plugins: {
9
+ storybook,
10
+ import: importPlugin,
11
+ },
36
12
  },
37
13
 
14
+ ...storybook.configs['flat/recommended'],
15
+ ...storybook.configs['flat/csf-strict'],
16
+
38
17
  {
39
- files: ['**/.storybook/**/*.@(ts|tsx|js|jsx|mjs|cjs)'],
40
- ...storybookRuleSetConfig,
18
+ files: ['**/*.@(stories|story).@(ts|tsx|js|jsx|mjs|cjs)'],
19
+ rules: {
20
+ 'import/no-default-export': ['off'],
21
+ },
41
22
  },
42
23
  ];
@@ -1,38 +1,34 @@
1
- // @ts-check
2
- import typescriptEslint from '@typescript-eslint/eslint-plugin';
3
- import typescriptEslintParser from '@typescript-eslint/parser';
1
+ import tseslint from 'typescript-eslint';
4
2
  import typescriptRuleSetBase from '../../rules/typescript.js';
5
3
 
6
4
  const typescriptRuleSet = {
7
5
  plugins: {
8
- '@typescript-eslint': typescriptEslint,
9
- },
10
- rules: {
11
- ...typescriptEslint.configs['eslint-recommended'].overrides?.[0].rules,
12
- ...typescriptEslint.configs['strict-type-checked'].rules,
13
- ...typescriptEslint.configs['stylistic-type-checked'].rules,
14
- ...typescriptRuleSetBase.rules,
6
+ '@typescript-eslint': tseslint.plugin,
15
7
  },
8
+ extends: [
9
+ ...tseslint.configs.strictTypeChecked,
10
+ ...tseslint.configs.stylisticTypeChecked,
11
+ ],
12
+ rules: typescriptRuleSetBase.rules,
16
13
  };
17
14
 
18
- export default [
19
- {
20
- files: ['**/*.@(ts|tsx|cts|mts)'],
15
+ export default tseslint.config({
16
+ files: ['**/*.@(ts|tsx|cts|mts)'],
21
17
 
22
- languageOptions: {
23
- parser: typescriptEslintParser,
24
- parserOptions: {
25
- project: true,
26
- },
18
+ languageOptions: {
19
+ parser: tseslint.parser,
20
+ parserOptions: {
21
+ projectService: true,
22
+ tsconfigRootDir: process.env.TSCONFIG_ROOT_DIR ?? import.meta.dirname,
27
23
  },
24
+ },
28
25
 
29
- settings: {
30
- // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#importparsers
31
- 'import/parsers': {
32
- '@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'],
33
- },
26
+ settings: {
27
+ // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#importparsers
28
+ 'import/parsers': {
29
+ '@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'],
34
30
  },
35
-
36
- ...typescriptRuleSet,
37
31
  },
38
- ];
32
+
33
+ ...typescriptRuleSet,
34
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-moneyforward",
3
- "version": "4.1.1",
3
+ "version": "5.0.0",
4
4
  "description": "Money Forward's ESLint rules as an extensible shared config.",
5
5
  "exports": {
6
6
  "./flat": {
@@ -16,7 +16,7 @@
16
16
  "./typescript": "./configs/eslintrc/typescript.js"
17
17
  },
18
18
  "engines": {
19
- "node": ">= 18.18.0 || >= 20.0.0"
19
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
20
20
  },
21
21
  "files": [
22
22
  "configs",
@@ -39,39 +39,42 @@
39
39
  },
40
40
  "homepage": "https://github.com/moneyforward/eslint-config-moneyforward#readme",
41
41
  "dependencies": {
42
- "@next/eslint-plugin-next": "^14.1.3",
43
- "@typescript-eslint/eslint-plugin": "^7.10.0",
44
- "@typescript-eslint/parser": "^7.10.0",
42
+ "@next/eslint-plugin-next": "^15.0.3",
43
+ "@typescript-eslint/eslint-plugin": "^8.16.0",
44
+ "@typescript-eslint/parser": "^8.16.0",
45
45
  "confusing-browser-globals": "^1.0.11",
46
- "eslint-import-resolver-typescript": "^3.6.1",
47
- "eslint-plugin-import": "^2.29.1",
48
- "eslint-plugin-jest": "^28.5.0",
49
- "eslint-plugin-jest-dom": "^5.1.0",
50
- "eslint-plugin-jsdoc": "^48.2.1",
51
- "eslint-plugin-jsx-a11y": "^6.8.0",
52
- "eslint-plugin-n": "^17.7.0",
53
- "eslint-plugin-promise": "^6.1.1",
54
- "eslint-plugin-react": "^7.34.0",
55
- "eslint-plugin-react-hooks": "^4.6.0",
56
- "eslint-plugin-storybook": "^0.8.0",
57
- "eslint-plugin-testing-library": "^6.2.2",
58
- "globals": "^15.9.0"
46
+ "eslint-import-resolver-typescript": "^3.6.3",
47
+ "eslint-plugin-import": "^2.31.0",
48
+ "eslint-plugin-jest": "^28.9.0",
49
+ "eslint-plugin-jest-dom": "^5.5.0",
50
+ "eslint-plugin-jsdoc": "^50.6.0",
51
+ "eslint-plugin-jsx-a11y": "^6.10.2",
52
+ "eslint-plugin-n": "^17.14.0",
53
+ "eslint-plugin-promise": "^7.2.1",
54
+ "eslint-plugin-react": "^7.37.2",
55
+ "eslint-plugin-react-hooks": "^5.0.0",
56
+ "eslint-plugin-storybook": "^0.11.1",
57
+ "eslint-plugin-testing-library": "^7.0.0",
58
+ "eslint-plugin-unicorn": "^56.0.1",
59
+ "globals": "^15.11.0",
60
+ "typescript-eslint": "^8.16.0"
59
61
  },
60
62
  "devDependencies": {
61
63
  "@semantic-release/changelog": "6.0.3",
62
64
  "@semantic-release/git": "10.0.1",
63
- "eslint": "8.57.0",
65
+ "conventional-changelog-conventionalcommits": "8.0.0",
66
+ "eslint": "9.16.0",
64
67
  "eslint-config-prettier": "9.1.0",
65
68
  "jest": "29.7.0",
66
- "prettier": "3.3.3",
67
- "prettier-plugin-organize-imports": "3.2.4",
68
- "semantic-release": "23.1.1",
69
- "typescript": "5.5.4"
69
+ "prettier": "3.4.2",
70
+ "prettier-plugin-organize-imports": "4.1.0",
71
+ "semantic-release": "24.2.0",
72
+ "typescript": "5.7.2"
70
73
  },
71
74
  "peerDependencies": {
72
- "eslint": "^8.56.0",
75
+ "eslint": "^8.57.0 || ^9.0.0",
73
76
  "jest": "*",
74
- "typescript": "^4.7.5 || ^5.0.0"
77
+ "typescript": "^4.8.4 || ^5.0.0"
75
78
  },
76
79
  "peerDependenciesMeta": {
77
80
  "jest": {
package/rules/imports.js CHANGED
@@ -28,7 +28,7 @@ module.exports = {
28
28
  'import/core-modules': [],
29
29
  'import/ignore': [
30
30
  'node_modules',
31
- '\\.(coffee|scss|css|less|hbs|svg|json|jpg|jpeg|png|webp)$',
31
+ String.raw`\.(coffee|scss|css|less|hbs|svg|json|jpg|jpeg|png|webp)$`,
32
32
  ],
33
33
  // TODO: Remove this once eslint-plugin-import supports Flat Config completely.
34
34
  // https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561
@@ -35,13 +35,6 @@ module.exports = {
35
35
  '@typescript-eslint/prefer-promise-reject-errors':
36
36
  baseBestPracticesRules['prefer-promise-reject-errors'],
37
37
 
38
- // Disallow throwing literals as exceptions.
39
- // https://typescript-eslint.io/rules/no-throw-literal/
40
- // Replace 'no-throw-literal' rule with '@typescript-eslint' version
41
- // TODO: Disable this rule if you are using the React.Suspense.
42
- '@typescript-eslint/no-throw-literal':
43
- baseBestPracticesRules['no-throw-literal'],
44
-
45
38
  // Enforce naming conventions for everything across a codebase.
46
39
  // https://typescript-eslint.io/rules/naming-convention/
47
40
  // Replace 'camelcase' rule with '@typescript-eslint/naming-convention'
@@ -0,0 +1,114 @@
1
+ module.exports = {
2
+ plugins: ['unicorn'],
3
+ extends: ['plugin:unicorn/recommended'],
4
+ rules: {
5
+ // Move function definitions to the highest possible scope.
6
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
7
+ // To clarify the scope of a function, it may be better to define it nested.
8
+ 'unicorn/consistent-function-scoping': ['off'],
9
+
10
+ // Enforce a case style for filenames.
11
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
12
+ // The common naming convention for modules in JavaScript is `camelCase` or `PascalCase`,
13
+ // so it is desirable to align the file naming convention with it.
14
+ 'unicorn/filename-case': [
15
+ 'error',
16
+ {
17
+ cases: {
18
+ camelCase: true,
19
+ pascalCase: true,
20
+ },
21
+ },
22
+ ],
23
+
24
+ // Enforce the use of new for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
25
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
26
+ // This rule conflicts with the `no-new-array` rule.
27
+ // This rule cannot be excluded for `array` alone, so we will be forced to disable it completely.
28
+ 'unicorn/new-for-builtins': ['off'],
29
+
30
+ // Prevent passing a function reference directly to iterator methods.
31
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
32
+ // If you use TypeScript properly, you will rarely encounter this trouble.
33
+ 'unicorn/no-array-callback-reference': ['off'],
34
+
35
+ // Prefer `for…of` over the `forEach` method.
36
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
37
+ // `forEach` is too readable to be banned.
38
+ 'unicorn/no-array-for-each': ['off'],
39
+
40
+ // Disallow `Array#reduce()` and `Array#reduceRight()`.
41
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
42
+ // It's true that `reduce` can impair readability depending on how it is used,
43
+ // but it is too shame to be banned.
44
+ 'unicorn/no-array-reduce': ['off'],
45
+
46
+ // Disallow negated conditions.
47
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
48
+ // Whether a negated condition is difficult to read depends on the context.
49
+ 'unicorn/no-negated-condition': ['off'],
50
+
51
+ // Disallow the use of the `null` literal.
52
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-null.md
53
+ // `undefined` and `null` have completely different meanings, so it's incorrect in JavaScript to standardize on `undefined`.
54
+ 'unicorn/no-null': ['off'],
55
+
56
+ // Enforce the use of globalThis over window, self, and global.
57
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
58
+ // Although effective when the JavaScript execution environment is uncertain, there're many more well-defined use cases.
59
+ // So, it's not that important.
60
+ 'unicorn/prefer-global-this': ['off'],
61
+
62
+ // Prevent abbreviations.
63
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
64
+ // Use of widely recognized abbreviations is acceptable.
65
+ 'unicorn/prevent-abbreviations': [
66
+ 'error',
67
+ {
68
+ allowList: {
69
+ Acc: true,
70
+ acc: true,
71
+ Args: true,
72
+ args: true,
73
+ i: true,
74
+ j: true,
75
+ Num: true,
76
+ num: true,
77
+ Param: true,
78
+ param: true,
79
+ Params: true,
80
+ params: true,
81
+ Prop: true,
82
+ prop: true,
83
+ Props: true,
84
+ props: true,
85
+ Ref: true,
86
+ ref: true,
87
+ Refs: true,
88
+ refs: true,
89
+ Src: true,
90
+ src: true,
91
+ Var: true,
92
+ var: true,
93
+ },
94
+ },
95
+ ],
96
+
97
+ // Enforce consistent brace style for case clauses.
98
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md
99
+ // Forcing braces into every use case is a bit too much.
100
+ 'unicorn/switch-case-braces': ['error', 'avoid'],
101
+ },
102
+
103
+ overrides: [
104
+ {
105
+ files: ['*.@(jsx|tsx)'],
106
+ rules: {
107
+ // Disallow anonymous functions and classes as the default export.
108
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-anonymous-default-export.md
109
+ // This rule conflicts with the `react/function-component-definition` rule.
110
+ 'unicorn/no-anonymous-default-export': ['off'],
111
+ },
112
+ },
113
+ ],
114
+ };
@@ -39,12 +39,11 @@ module.exports = {
39
39
  name: 'isNaN',
40
40
  message: 'Use Number.isNaN instead.',
41
41
  },
42
- ].concat(
43
- confusingBrowserGlobals.map((g) => ({
42
+ ...confusingBrowserGlobals.map((g) => ({
44
43
  name: g,
45
44
  message: `Use window.${g} instead.`,
46
45
  })),
47
- ),
46
+ ],
48
47
 
49
48
  // disallow declaration of variables already declared in the outer scope
50
49
  // https://eslint.org/docs/rules/no-shadow