-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
eslint.config.js
66 lines (64 loc) · 2.08 KB
/
eslint.config.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
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
import stylisticTs from '@stylistic/eslint-plugin-ts';
import stylisticJs from '@stylistic/eslint-plugin-js';
import tsParser from '@typescript-eslint/parser';
import js from '@eslint/js';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import globals from 'globals';
import { includeIgnoreFile } from '@eslint/compat';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');
export default [
js.configs.recommended,
prettierRecommended,
...tseslint.configs.recommended,
includeIgnoreFile(gitignorePath),
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: tsParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
},
},
files: ['website/**/*.ts', 'website/**/*.tsx', 'website/**/*.js', 'website/**/*.jsx'],
plugins: {
'@stylistic/ts': stylisticTs,
'@stylistic/js': stylisticJs,
react,
},
rules: {
'@stylistic/ts/indent': ['error', 2],
'@stylistic/js/linebreak-style': ['error', 'unix'],
'@stylistic/ts/quotes': ['error', 'single'],
'@stylistic/ts/semi': ['error', 'always'],
'@stylistic/js/max-len': ['error', { code: 100 }],
'@typescript-eslint/no-explicit-any': ['off'],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'prefer-promise-reject-errors': ['off'],
'react/jsx-filename-extension': ['warn', { extensions: ['.tsx'] }],
'no-return-assign': ['off'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'import/prefer-default-export': 'off',
'prettier/prettier': ['error', { singleQuote: true }],
},
},
];