-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy patheslint.config.mjs
128 lines (121 loc) · 3 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import path from "path";
import { fileURLToPath } from "url";
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname, // optional; default: process.cwd()
resolvePluginsRelativeTo: __dirname, // optional
recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended"
});
export default [
...compat.extends("plugin:json/recommended-legacy", "plugin:ft-flow/recommended", "prettier"),
...compat.env({
browser: true,
webextensions: true,
jquery: true,
es6: true,
es2024: true
}),
...compat.plugins("ft-flow"),
{
"ignores": [
"node_modules",
".wdm",
".pbin",
".github",
".husky",
"dist",
"*.code-workspace",
"*.lock",
"*.toml",
"*.cjs",
"*.css",
"package-lock.json",
"scripts",
"src/js/flow-typed*"
],
},
...compat.config({
"root": true,
"parser": "hermes-eslint",
"overrides": [
{
"files": [
"src/js/**/*.mjs"
],
"parserOptions": {
"sourceType": "module"
}
},
{
"files": [
"tests/**/*.mjs"
],
"env": {
"jest": true
}
}
],
"globals": {
"__OdooTerminal": "readonly",
"_": "off",
"moment": "readonly",
"odoo": "readonly",
"owl": "readonly",
"luxon": "readonly",
"openerp": "off"
},
"rules": {
"eqeqeq": "error",
"no-empty-function": "error",
"no-eval": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "off",
"no-implied-eval": "error",
"no-return-assign": "error",
"no-undef-init": "error",
"no-shadow": "error",
"no-script-url": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "error",
"no-labels": "error",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-void": "error",
"no-unused-vars": [
"error",
{
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
}
],
"no-console": [
"warn",
{
"allow": [
"info",
"warn",
"error"
]
}
],
"prefer-const": "error",
"prefer-numeric-literals": "error",
"prefer-object-has-own": "error",
"spaced-comment": "error",
"radix": "error",
"prefer-arrow-callback": "warn",
"no-var": "warn",
"no-extra-bind": "warn",
"no-lone-blocks": "warn"
}
}),
]