-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
67 lines (65 loc) · 2.07 KB
/
.eslintrc.cjs
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
// @ts-check
const project = './tsconfig.eslint.json'
/** @type {import('eslint').Linter.Config} */
module.exports = {
$schema: 'https://json.schemastore.org/eslintrc',
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project,
},
extends: [
'plugin:astro/recommended',
'plugin:tailwindcss/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
plugins: ['unused-imports', 'simple-import-sort', 'preferred-import'],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project,
},
},
},
rules: {
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-unresolved': ['error', { ignore: ['^astro'] }],
'import/order': 'off', // handled by simple-import-sort/imports
'no-unused-vars': 'off', // handled by unused-imports/no-unused-vars
'preferred-import/ts-imports': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
project,
extraFileExtensions: ['.astro'],
},
},
{
files: ['**/*.{ts,tsx}'],
},
{
// ensures to also lint these extensions
files: ['**/*.{c,m}js'],
},
],
// improves performance by ignoring node_modules
ignorePatterns: ['node_modules', 'LICENSE', '*.{md,mo,svg,lockb}', 'dist', 'src/declarations'],
}