-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.js
41 lines (41 loc) · 1.11 KB
/
.eslintrc.js
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
module.exports = {
parser: '@babel/eslint-parser', // Default parser for JavaScript files
extends: [
'eslint:recommended',
'plugin:prettier/recommended', // Integrates Prettier with ESLint
],
plugins: ['prettier'],
env: {
browser: true,
es2021: true,
node: true,
},
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
requireConfigFile: false, // For @babel/eslint-parser to work without a Babel config file
},
rules: {
'prettier/prettier': 'error',
'no-console': 'warn',
},
overrides: [
{
files: ['*.ts', '*.tsx'], // Targeting TypeScript files
parser: '@typescript-eslint/parser', // Specifies the ESLint parser for TypeScript
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
// You can override/add specific rules for TypeScript files here
},
},
],
};