Skip to content

Commit a22b40f

Browse files
committed
chore(deps-dev): migrate to ESLint v9
1 parent 05a411e commit a22b40f

File tree

10 files changed

+428
-298
lines changed

10 files changed

+428
-298
lines changed

.eslintignore

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

.eslintrc.cjs

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

dist/ColorPicker.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ type ColorRgb = {
3131
b: number;
3232
a: number;
3333
};
34-
type ColorMap = {
34+
interface ColorMap {
3535
hex: string;
3636
hsl: ColorHsl;
3737
hsv: ColorHsv;
3838
hwb: ColorHwb;
3939
rgb: ColorRgb;
40-
};
41-
type ColorChangeDetail = {
40+
}
41+
interface ColorChangeDetail {
4242
colors: ColorMap;
4343
cssColor: string;
44-
};
44+
}
4545
type ColorFormat = keyof ColorMap;
4646
type VisibleColorFormat = Exclude<ColorFormat, 'hsv'>;
4747
interface ColorPairHex {

eslint.config.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import eslint from '@eslint/js'
2+
import stylistic from '@stylistic/eslint-plugin'
3+
import globals from 'globals'
4+
import tseslint from 'typescript-eslint'
5+
6+
export default tseslint.config(
7+
{
8+
ignores: ['coverage/', 'dist/'],
9+
},
10+
eslint.configs.recommended,
11+
...tseslint.configs.strict,
12+
...tseslint.configs.stylistic,
13+
{
14+
files: ['**/*.{js,ts}'],
15+
languageOptions: {
16+
globals: {
17+
...globals.browser,
18+
},
19+
},
20+
plugins: {
21+
'@stylistic': stylistic,
22+
},
23+
rules: {
24+
// Interferes with `get [Symbol.toStringTag]`.
25+
'@typescript-eslint/class-literal-property-style': 'off',
26+
// Don't care.
27+
'@typescript-eslint/no-non-null-assertion': 'off',
28+
// Intereferes with assigning Color* object types to `Record<string, unknown>`.
29+
'@typescript-eslint/consistent-type-definitions': 'off',
30+
31+
'@stylistic/comma-dangle': ['error', 'always-multiline'],
32+
'@stylistic/indent': ['error', 'tab'],
33+
'@stylistic/semi': ['error', 'never'],
34+
'@stylistic/space-before-function-paren': ['error', 'always'],
35+
'@stylistic/quotes': ['error', 'single'],
36+
},
37+
},
38+
{
39+
files: ['**/*.test.{js,ts}'],
40+
rules: {
41+
'@typescript-eslint/ban-ts-comment': 'off',
42+
},
43+
},
44+
)

0 commit comments

Comments
 (0)