-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy patheslint.config.mjs
46 lines (45 loc) · 1.45 KB
/
eslint.config.mjs
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
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginJest from "eslint-plugin-jest";
import pluginPromise from "eslint-plugin-promise";
/** @type {import('eslint').Linter.Config[]} */
export default [
{ignores: ["*.config.*"]},
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
pluginPromise.configs['flat/recommended'],
{
files: ['**/*.spec.js', '**/*.test.js'],
plugins: { jest: pluginJest },
languageOptions: {
globals: pluginJest.environments.globals.globals,
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
},
{
rules: {
"max-len": [1, 120, 2, { "ignoreComments": true }],
"no-console": "off",
"quotes": ["error", "single"],
"camelcase": ["error", {"properties": "always"}],
"semi": ["warn", "always"],
"comma-dangle": ["warn", "only-multiline"],
"dot-notation": "warn",
"space-before-function-paren": "off",
"indent": ["warn", 2],
"padded-blocks": "warn",
"no-trailing-spaces": "warn",
"array-bracket-spacing": "warn",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"padded-blocks": ["error", "never"],
"no-var": "error",
},
},
];