Skip to content

Commit 3ea58d4

Browse files
committed
consolidate eslint configs
1 parent 387b352 commit 3ea58d4

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

eslint.config.mjs

+11-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
import * as react from '@chance/eslint/react';
33
import * as js from '@chance/eslint';
44
import * as typescript from '@chance/eslint/typescript';
5+
import { globals } from '@chance/eslint/globals';
56
import storybook from 'eslint-plugin-storybook';
7+
import pluginCypress from 'eslint-plugin-cypress/flat';
68

79
/** @type {import("eslint").Linter.Config[]} */
810
export default [
9-
js.config,
11+
{ ...js.getConfig({ ...globals.node, ...globals.browser }) },
1012
typescript.config,
11-
react.config,
12-
...storybook.configs['flat/recommended'],
1313
{
14+
...react.config,
1415
rules: {
16+
...react.rules,
1517
'react/jsx-pascal-case': ['warn', { allowNamespace: true }],
1618
// TODO: enable this and fix all the errors
1719
'react/display-name': 'off',
@@ -25,8 +27,12 @@ export default [
2527
],
2628
},
2729
},
30+
...storybook.configs['flat/recommended'],
31+
{ ...pluginCypress.configs.recommended, files: ['cypress/**/*.cy.ts'] },
2832
{
29-
files: ['**/*.js', '**/*.mjs', '**/*.ts', '**/*.tsx'],
30-
ignores: ['dist/**'],
33+
ignores: ['dist/**', '.next/**'],
34+
rules: {
35+
'prefer-const': ['warn', { destructuring: 'all' }],
36+
},
3137
},
3238
];
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import * as js from '@chance/eslint';
22
import * as typescript from '@chance/eslint/typescript';
3-
import pluginCypress from 'eslint-plugin-cypress/flat';
43

54
/** @type {import("eslint").Linter.Config[]} */
65
const config = [
7-
js.config,
6+
//
7+
js.getConfig(),
88
typescript.config,
9-
pluginCypress.configs.recommended, //
109
];
1110

1211
export default config;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"format": "prettier --write ."
3232
},
3333
"devDependencies": {
34-
"@chance/eslint": "^1.0.0",
34+
"@chance/eslint": "^1.1.0",
3535
"@changesets/cli": "^2.27.11",
3636
"@radix-ui/colors": "^3.0.0",
3737
"@storybook/addon-essentials": "^8.5.0",

yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ __metadata:
282282
languageName: node
283283
linkType: hard
284284

285-
"@chance/eslint@npm:^1.0.0":
286-
version: 1.0.0
287-
resolution: "@chance/eslint@npm:1.0.0"
285+
"@chance/eslint@npm:^1.1.0":
286+
version: 1.1.0
287+
resolution: "@chance/eslint@npm:1.1.0"
288288
dependencies:
289289
"@eslint/compat": "npm:^1.2.3"
290290
"@typescript-eslint/eslint-plugin": "npm:^8.16.0"
@@ -298,7 +298,7 @@ __metadata:
298298
globals: "npm:^15.12.0"
299299
peerDependencies:
300300
eslint: ^9.0.0
301-
checksum: 10/b3359a41637986e8643abb5af089739ee49ee7d1c6d343613ec0756c02f0a5afb96a422a1f9f60d655cbffcc5e1d1f65ab4c3984482e5a4d819f0f3c9ffa75f6
301+
checksum: 10/e454af30e88ce0f118d79d73df53b8f97bf5093d86f253e1fc375bfcea3d251b9f828687a60c1b1b989cad6945a54ce0f3e23518157816f72b124a6d4b6064ad
302302
languageName: node
303303
linkType: hard
304304

@@ -11320,7 +11320,7 @@ __metadata:
1132011320
version: 0.0.0-use.local
1132111321
resolution: "primitives@workspace:."
1132211322
dependencies:
11323-
"@chance/eslint": "npm:^1.0.0"
11323+
"@chance/eslint": "npm:^1.1.0"
1132411324
"@changesets/cli": "npm:^2.27.11"
1132511325
"@radix-ui/colors": "npm:^3.0.0"
1132611326
"@storybook/addon-essentials": "npm:^8.5.0"

0 commit comments

Comments
 (0)