-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
96 lines (94 loc) · 2.5 KB
/
eslint.config.js
File metadata and controls
96 lines (94 loc) · 2.5 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 typescriptEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import importPlugin from 'eslint-plugin-import'
import litPlugin from 'eslint-plugin-lit'
import prettierConfig from 'eslint-config-prettier'
import storybookPlugin from 'eslint-plugin-storybook'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
export default [
{
ignores: [
'node_modules/**',
'dist/**',
'package/**',
'templates/**',
'eslint.config.js',
'**/*.json',
'storybook-static/**',
'.work/**',
],
},
{
files: ['src/**/*.ts', 'src/**/*.js', '*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
sourceType: 'module',
},
globals: {
browser: true,
node: true,
es6: true,
webextensions: true,
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
import: importPlugin,
lit: litPlugin,
storybook: storybookPlugin,
},
settings: {
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.css', '.scss', '.json'],
},
},
'import/parser': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
rules: {
...typescriptEslint.configs.recommended.rules,
...importPlugin.configs.recommended.rules,
...litPlugin.configs.recommended.rules,
...prettierConfig.rules,
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-debugger': 'error',
'no-unused-vars': 'off',
'import/order': [
'error',
{
groups: [
['builtin', 'external', 'index'],
['sibling', 'parent', 'internal'],
'object',
'type',
],
'newlines-between': 'always',
},
],
'lit/attribute-value-entities': 'off',
},
},
{
files: ['*.cjs', '*.mjs', './package/**/*.{cjs,js}', './dist/**/*.js'],
languageOptions: {
sourceType: 'commonjs',
ecmaVersion: 2020,
},
rules: {
complexity: 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-empty-function': 0,
},
},
]