-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
96 lines (93 loc) · 1.98 KB
/
Copy patheslint.config.js
File metadata and controls
96 lines (93 loc) · 1.98 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
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import globals from 'globals';
import header from '@tony.ganchev/eslint-plugin-header';
export default [
{
ignores: [
'**/dist',
'**/node_modules',
'**/.vite',
'**/build',
'**/coverage',
'**/.next',
'**/storybook-static',
'**/vite-env.d.ts',
'app/**', // App has its own config with React rules
],
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.node,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
header: header,
'@typescript-eslint': typescript,
},
rules: {
...typescript.configs.recommended.rules,
// TypeScript
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_|^React$',
vars: 'all',
args: 'none',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
fixStyle: 'inline-type-imports',
},
],
// General
'no-unused-vars': 'off',
'no-console': 'warn',
'no-case-declarations': 'off',
'prefer-const': 'error',
'no-implicit-coercion': [
'error',
{ number: true, string: true, boolean: false },
],
'header/header': [
2,
'line',
{
pattern:
' Copyright \\(c\\) (Mysten Labs, Inc\\.\\n Modifications Copyright \\(c\\) 20\\d{2} IOTA Stiftung|20\\d{2} IOTA Stiftung)\\n SPDX-License-Identifier: Apache-2\\.0',
},
2,
],
},
},
// Test files can use any and have relaxed rules
{
files: [
'**/*.test.ts',
'**/*.test.tsx',
'**/*.spec.ts',
'**/*.spec.tsx',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'no-console': 'off',
},
},
];