Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit acceb01

Browse filesBrowse files
committed
build: update ESLint to v9.x
1 parent d5b9a4d commit acceb01
Copy full SHA for acceb01

File tree

6 files changed

+111
-80
lines changed
Filter options

6 files changed

+111
-80
lines changed

‎.eslintignore

Copy file name to clipboardExpand all lines: .eslintignore
-2Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.eslintrc.js

Copy file name to clipboardExpand all lines: .eslintrc.js
-72Lines changed: 0 additions & 72 deletions
This file was deleted.

‎eslint.config.mjs

Copy file name to clipboard
+104Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import eslint from '@eslint/js'
2+
import tsParser from '@typescript-eslint/parser'
3+
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
4+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
5+
import eslintPluginReact from 'eslint-plugin-react'
6+
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
7+
import globals from 'globals'
8+
import typescriptEslint from 'typescript-eslint'
9+
10+
export default typescriptEslint.config(
11+
{ ignores: ['**/*.d.ts', '**/coverage', '**/dist', 'eslint.config.mjs'] },
12+
{
13+
extends: [
14+
eslint.configs.recommended,
15+
...typescriptEslint.configs.recommended,
16+
eslintPluginUnicorn.configs['flat/recommended'],
17+
eslintPluginReact.configs.flat.recommended,
18+
eslintPluginReact.configs.flat['jsx-runtime'],
19+
],
20+
plugins: {
21+
'react-hooks': eslintPluginReactHooks,
22+
},
23+
files: ['packages/**/src/**/*.{js,ts,tsx}'],
24+
languageOptions: {
25+
globals: {
26+
...globals.browser,
27+
...globals.node,
28+
},
29+
parser: tsParser,
30+
ecmaVersion: 'latest',
31+
sourceType: 'module',
32+
parserOptions: {
33+
ecmaFeatures: {
34+
jsx: true,
35+
},
36+
},
37+
},
38+
settings: {
39+
react: {
40+
pragma: 'React',
41+
version: 'detect',
42+
},
43+
},
44+
rules: {
45+
...eslintPluginReactHooks.configs.recommended.rules,
46+
'no-console': 'off',
47+
'no-debugger': 'off',
48+
'unicorn/filename-case': 'off',
49+
'unicorn/no-array-for-each': 'off',
50+
'unicorn/no-null': 'off',
51+
'unicorn/prefer-dom-node-append': 'off',
52+
'unicorn/prefer-export-from': 'off',
53+
'unicorn/prefer-query-selector': 'off',
54+
'unicorn/prevent-abbreviations': 'off',
55+
'vue/require-default-prop': 'off',
56+
},
57+
},
58+
{
59+
files: ['**/*.mjs'],
60+
languageOptions: {
61+
globals: {
62+
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
63+
...globals.node,
64+
},
65+
66+
ecmaVersion: 5,
67+
sourceType: 'module',
68+
},
69+
},
70+
{
71+
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
72+
languageOptions: {
73+
globals: {
74+
...globals.jest,
75+
},
76+
},
77+
},
78+
{
79+
files: ['packages/docs/build/**'],
80+
languageOptions: {
81+
globals: {
82+
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
83+
...globals.node,
84+
},
85+
86+
ecmaVersion: 5,
87+
sourceType: 'commonjs',
88+
},
89+
rules: {
90+
'@typescript-eslint/no-var-requires': 'off',
91+
'no-console': 'off',
92+
'unicorn/prefer-module': 'off',
93+
'unicorn/prefer-top-level-await': 'off',
94+
},
95+
},
96+
{
97+
files: ['packages/docs/**'],
98+
rules: {
99+
'@typescript-eslint/no-var-requires': 'off',
100+
'unicorn/prefer-module': 'off',
101+
},
102+
},
103+
eslintPluginPrettierRecommended,
104+
)

‎package.json

Copy file name to clipboardExpand all lines: package.json
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@
2222
"test:update": "npm-run-all charts:test:update icons:test:update lib:test:update"
2323
},
2424
"devDependencies": {
25-
"@typescript-eslint/eslint-plugin": "^8.19.0",
26-
"@typescript-eslint/parser": "^8.19.0",
27-
"eslint": "8.57.0",
25+
"@typescript-eslint/parser": "^8.19.1",
26+
"eslint": "^9.17.0",
2827
"eslint-config-prettier": "^9.1.0",
2928
"eslint-plugin-prettier": "^5.2.1",
3029
"eslint-plugin-react": "^7.37.3",
3130
"eslint-plugin-react-hooks": "^5.1.0",
3231
"eslint-plugin-unicorn": "^56.0.1",
32+
"globals": "^15.14.0",
3333
"lerna": "^8.1.9",
3434
"npm-run-all": "^4.1.5",
35-
"prettier": "^3.4.2"
35+
"prettier": "^3.4.2",
36+
"typescript-eslint": "^8.19.1"
3637
},
3738
"overrides": {
3839
"gatsby-remark-external-links": {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.