-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
41 lines (40 loc) · 1.34 KB
/
eslint.config.mjs
File metadata and controls
41 lines (40 loc) · 1.34 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
import { ESLint } from 'eslint';
import typescriptParser from '@typescript-eslint/parser'; // Import the TypeScript parser
import eslintPluginReact from 'eslint-plugin-react';
import eslintPluginTypeScript from '@typescript-eslint/eslint-plugin';
export default [
{
ignores: [
'**/node_modules/', // Ignore node_modules
'**/dist/', // Ignore dist directory
'**/build/' // Ignore build directory
]
},
{
files: ['src/**/*.{js,jsx,ts,tsx}'], // Target source files
languageOptions: {
parser: typescriptParser, // Set the TypeScript parser
parserOptions: {
ecmaVersion: 2022, // Modern ECMAScript features
sourceType: 'module', // Enable ES Modules
ecmaFeatures: {
jsx: true // Enable JSX
}
},
globals: {
...ESLint.configGlobals // Include default globals
}
},
plugins: {
'@typescript-eslint': eslintPluginTypeScript, // TypeScript plugin
react: eslintPluginReact // React plugin
},
rules: {
// Recommended ESLint rules
'react/prop-types': 'off', // Disable prop-types rule
'@typescript-eslint/no-explicit-any': 'warn', // Warn on explicit `any` usage
'react/jsx-uses-react': 'off', // No longer needed with React 17+
'react/react-in-jsx-scope': 'off' // No longer needed with React 17+
}
}
];