-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (61 loc) · 2.11 KB
/
eslint.config.js
File metadata and controls
62 lines (61 loc) · 2.11 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
const js = require( "@eslint/js");
const { defineConfig } = require("eslint/config");
const preferArrow = require( "eslint-plugin-prefer-arrow");
const prettierConfig = require( "eslint-config-prettier");
const prettierPlugin = require( "eslint-plugin-prettier");
const stylistic = require( "@stylistic/eslint-plugin");
const typescriptParser = require( "@typescript-eslint/parser");
const typescriptEslint = require( "@typescript-eslint/eslint-plugin");
module.exports = defineConfig([
{
// Applies to all files
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2022, // Allows for the parsing of modern ECMAScript features
sourceType: "module",
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
globals: {
process: "readonly",
}
},
plugins: {
"prefer-arrow": preferArrow,
"prettier": prettierPlugin,
"@stylistic": stylistic,
},
rules: {
"func-style": ["error", "expression"],
"prefer-arrow/prefer-arrow-functions": "error",
"prettier/prettier": "error", // Ensure Prettier formatting issues are reported as ESLint errors
...js.configs.recommended.rules,
"no-undef": "warn",
"no-unused-vars": "warn",
...stylistic.configs.recommended.rules, // Integrate Stylistic rules
"@stylistic/quotes": "off",
"@stylistic/semi": "off",
"@stylistic/member-delimiter-style": "off",
"@stylistic/brace-style" : "off",
"@stylistic/operator-linebreak" : "off",
"@stylistic/indent" : "off",
"@stylistic/arrow-parens" : "off",
"@stylistic/indent-binary-ops" : "off",
"@stylistic/quote-props" : "off",
...prettierConfig.rules, // Integrate Prettier rules to disable conflicting ESLint rules
},
ignores: ["node_modules/**/*"],
},
{
// Applies to files in src directory
files: ["!src/tests/**/*"],
plugins: {
"@typescript-eslint": typescriptEslint,
},
rules: {
...typescriptEslint.configs.recommended.rules,
...typescriptEslint.configs['recommended-requiring-type-checking'].rules,
}
}
]);