Skip to content

Commit 1791375

Browse files
chore(deps): update dependency eslint to v9 (#643)
1 parent 491956b commit 1791375

File tree

27 files changed

+1706
-1045
lines changed

27 files changed

+1706
-1045
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

.storybook/main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { dirname, join } from 'path';
21
/**
32
* Copyright Zendesk, Inc.
43
*
54
* Use of this source code is governed under the Apache License, Version 2.0
65
* found at http://www.apache.org/licenses/LICENSE-2.0.
76
*/
87

9-
const path = require('path');
10-
const { readdirSync } = require('fs');
8+
const path = require('node:path');
9+
const { readdirSync } = require('node:fs');
1110
const { DefinePlugin } = require('webpack');
1211
const postcss = require('postcss');
1312
const tailwindcss = require('tailwindcss');
@@ -18,7 +17,7 @@ const PACKAGE_NAMES = readdirSync(path.resolve(__dirname, '../packages')).filter
1817
);
1918

2019
function getAbsolutePath(value) {
21-
return dirname(require.resolve(join(value, 'package.json')));
20+
return path.dirname(require.resolve(path.join(value, 'package.json')));
2221
}
2322

2423
const options = {

.storybook/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* found at http://www.apache.org/licenses/LICENSE-2.0.
66
*/
77

8-
const path = require('path');
8+
const path = require('node:path');
99
const gardenTailwindCss = require('@zendeskgarden/tailwindcss');
1010

1111
module.exports = {

eslint.config.mjs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* Copyright Zendesk, Inc.
3+
*
4+
* Use of this source code is governed under the Apache License, Version 2.0
5+
* found at http://www.apache.org/licenses/LICENSE-2.0.
6+
*/
7+
8+
import prettierConfig from 'eslint-config-prettier';
9+
import config from '@zendeskgarden/eslint-config';
10+
import noticePlugin from '@zendeskgarden/eslint-config/plugins/notice.js';
11+
import reactPlugin from '@zendeskgarden/eslint-config/plugins/react.js';
12+
import typescriptPlugin from '@zendeskgarden/eslint-config/plugins/typescript.js';
13+
import jestPlugin from '@zendeskgarden/eslint-config/plugins/jest.js';
14+
15+
const typescriptRules = {
16+
...typescriptPlugin.rules,
17+
'@typescript-eslint/explicit-function-return-type': 'off',
18+
'@typescript-eslint/explicit-module-boundary-types': 'off',
19+
'@typescript-eslint/naming-convention': 'off',
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
'n/no-unsupported-features/es-builtins': ['error', { version: '>=16.9.0' }],
22+
'react/prop-types': 'off'
23+
};
24+
25+
export default [
26+
...config,
27+
noticePlugin,
28+
reactPlugin,
29+
prettierConfig,
30+
{
31+
ignores: ['**/dist']
32+
},
33+
{
34+
rules: {
35+
'sort-imports': 'off',
36+
'react/jsx-no-useless-fragment': 'off'
37+
}
38+
},
39+
{
40+
files: ['packages/*/src/**/*.{ts,tsx}'],
41+
ignores: ['packages/.template/**/*.{ts,tsx}'],
42+
...typescriptPlugin,
43+
rules: typescriptRules
44+
},
45+
{
46+
files: ['packages/*/src/**/*.spec.{ts,tsx}'],
47+
ignores: ['packages/.template/**/*.spec.{ts,tsx}'],
48+
...typescriptPlugin,
49+
...jestPlugin,
50+
rules: {
51+
...typescriptRules,
52+
...jestPlugin.rules,
53+
'no-console': 'off',
54+
'jest/prefer-snapshot-hint': 'off',
55+
'jsx-a11y/label-has-associated-control': 'off',
56+
'react/button-has-type': 'off',
57+
'react/jsx-key': 'off'
58+
}
59+
},
60+
{
61+
files: ['packages/*/demo/**/*.{ts,tsx}'],
62+
ignores: ['packages/.template/demo/**/*.{ts,tsx}'],
63+
...typescriptPlugin,
64+
rules: {
65+
...typescriptRules,
66+
'func-name-matching': 'off',
67+
'react/button-has-type': 'off',
68+
'react/no-array-index-key': 'off'
69+
}
70+
}
71+
];

0 commit comments

Comments
 (0)