-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy patheslint.config.mjs
More file actions
123 lines (121 loc) · 3.86 KB
/
Copy patheslint.config.mjs
File metadata and controls
123 lines (121 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
import jsdoc from 'eslint-plugin-jsdoc';
import importPlugin from 'eslint-plugin-import';
export default tseslint.config(
{
ignores: ['dist', 'coverage', '.yarn', '.claude', 'src/@types', '*.{js,ts}'],
},
{
name: 'default',
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['src/**/*.{js,ts}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
import: importPlugin,
'unused-imports': unusedImports,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
camelcase: 'off',
semi: ['warn', 'always'],
eqeqeq: ['error', 'smart'],
'array-callback-return': 'error',
'arrow-body-style': 'error',
'comma-dangle': 'off',
'default-case': 'error',
'jsx-quotes': ['error', 'prefer-single'],
'linebreak-style': ['error', 'unix'],
'no-console': 'off',
'no-mixed-spaces-and-tabs': 'warn',
'no-self-compare': 'error',
'no-underscore-dangle': 'off',
'no-use-before-define': 'off',
'no-useless-concat': 'error',
'no-var': 'error',
'no-script-url': 'error',
'no-continue': 'off',
'object-shorthand': 'warn',
'prefer-const': 'warn',
'require-await': 'error',
'sort-imports': [
'error',
{
allowSeparatedGroups: true,
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'sort-keys': 'off',
'valid-typeof': 'error',
'max-classes-per-file': 'off',
'no-unused-expressions': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true, // TODO: set to false once React is in the dependencies (not devDependencies)
optionalDependencies: false,
peerDependencies: false,
},
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
ignoreRestSiblings: false,
caughtErrors: 'none',
},
],
'@typescript-eslint/no-unsafe-function-type': 'error',
'@typescript-eslint/no-wrapper-object-types': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-require-imports': 'off', // TODO: remove this rule once all files are .mjs (and require is not used)
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
ignores: ['src/gen/**'],
files: ['src/**/*.{js,ts}'],
plugins: {
jsdoc,
},
rules: {
'jsdoc/no-types': 'error',
'jsdoc/check-param-names': ['error', { checkDestructured: false }],
'jsdoc/check-tag-names': [
'error',
{ definedTags: ['internal', 'experimental', 'remarks'] },
],
'jsdoc/require-param-description': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }],
'jsdoc/no-multi-asterisks': 'error',
'jsdoc/empty-tags': 'error',
'jsdoc/no-bad-blocks': 'error',
},
},
);