Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (83 loc) 路 2.32 KB
/
Copy patheslint.config.js
File metadata and controls
84 lines (83 loc) 路 2.32 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
const nextConfig = require('eslint-config-next');
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const i18next = require('eslint-plugin-i18next');
module.exports = [
...nextConfig,
i18next.configs['flat/recommended'],
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
},
rules: {
...typescriptEslint.configs.recommended.rules,
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
},
},
{
files: ['**/*.ts', '**/*.tsx'],
ignores: ['lib/properties/**/*.ts'],
rules: {
'no-restricted-syntax': [
'error',
{
selector:
"TSAsExpression > TSTypeReference > Identifier[name='TaskProperties']",
message:
'Do not cast raw JSON to TaskProperties. Use a selector or parser from @/lib/properties.',
},
{
selector:
"TSAsExpression > TSTypeReference > Identifier[name='TeamProperties']",
message:
'Do not cast raw JSON to TeamProperties. Use a selector or parser from @/lib/properties.',
},
{
selector:
"TSTypeAssertion > TSTypeReference > Identifier[name='TaskProperties']",
message:
'Do not cast raw JSON to TaskProperties. Use a selector or parser from @/lib/properties.',
},
{
selector:
"TSTypeAssertion > TSTypeReference > Identifier[name='TeamProperties']",
message:
'Do not cast raw JSON to TeamProperties. Use a selector or parser from @/lib/properties.',
},
],
},
},
{
files: [
'next.config.js',
'next-i18next.config.js',
'tailwind.config.js',
'postcss.config.js',
'jest.config.js',
'*.config.js',
'*.config.cjs',
'*.config.mjs',
],
plugins: {
'@typescript-eslint': typescriptEslint,
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
];