-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
83 lines (74 loc) · 1.99 KB
/
eslint.config.js
File metadata and controls
83 lines (74 loc) · 1.99 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
// @ts-check
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import prettierConfig from 'eslint-config-prettier';
import globals from 'globals';
import nextShellPlugin from 'eslint-plugin-next-shell';
export default [
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/.next/**',
'**/out/**',
'**/.source/**',
'**/coverage/**',
'**/*.min.js',
'**/next-env.d.ts',
'pnpm-lock.yaml',
'.claude/skills/**',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx,js,jsx,mjs,cjs}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es2023,
},
},
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'next-shell': nextShellPlugin,
},
settings: {
react: { version: 'detect' },
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/consistent-type-imports': 'error',
// Enforce the semantic-token-only policy everywhere.
'next-shell/no-raw-colors': 'error',
},
},
// The ESLint plugin itself is plain JS — relax TS rules for it.
{
files: ['tools/eslint-plugin-next-shell/**/*.js'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
// Test files may occasionally reference raw colors in assertions.
{
files: ['**/*.test.{ts,tsx,js,jsx}', '**/tests/**/*.{ts,tsx,js,jsx}'],
rules: {
'next-shell/no-raw-colors': 'off',
},
},
prettierConfig,
];