-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
56 lines (55 loc) 路 1.43 KB
/
Copy patheslint.config.mjs
File metadata and controls
56 lines (55 loc) 路 1.43 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
import js from '@eslint/js';
import reactPlugin from 'eslint-plugin-react';
import astroPlugin from 'eslint-plugin-astro';
// astro-eslint-parser 3.x (exigido pelo astro 7: migrou para @astrojs/compiler-rs) deixou de
// expor default export. O namespace carrega `parseForESLint`, que e o contrato que o ESLint usa.
import * as astroParser from 'astro-eslint-parser';
import tsParser from '@typescript-eslint/parser';
export default [
{
ignores: ['dist/**', 'node_modules/**', '.astro/**'],
},
js.configs.recommended,
...astroPlugin.configs.recommended,
{
files: ['src/components/boards/**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
},
plugins: {
react: reactPlugin,
},
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'react/jsx-no-literals': ['error', { noStrings: true, ignoreProps: true }],
},
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['src/pages/admin/portfolio.astro'],
languageOptions: {
parser: astroParser,
parserOptions: {
parser: tsParser,
},
},
plugins: {
react: reactPlugin,
},
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'react/jsx-no-literals': ['error', { noStrings: true, ignoreProps: true }],
},
},
];