Skip to content

Commit 849ce78

Browse files
committed
migrate the three config files
1 parent 81e5b8e commit 849ce78

File tree

3 files changed

+163
-0
lines changed

3 files changed

+163
-0
lines changed

eslint.config.mjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import babelParser from "babel-eslint";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import js from "@eslint/js";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default [{
16+
ignores: [
17+
"services/web/client/source/resource/",
18+
"services/web/client/contrib/",
19+
"services/web/client/source-output/",
20+
"services/*node_modules/",
21+
"services/dy-modeling/client/source/resource/",
22+
"services/dy-modeling/client/source-output/",
23+
"services/dy-modeling/server/source/thrift/",
24+
],
25+
}, ...compat.extends("eslint:recommended"), {
26+
languageOptions: {
27+
globals: {
28+
osparc: false,
29+
window: false,
30+
},
31+
32+
parser: babelParser,
33+
},
34+
35+
rules: {
36+
"max-len": [2, 150],
37+
"new-cap": "off",
38+
"require-jsdoc": "off",
39+
"linebreak-style": ["error", "unix"],
40+
curly: ["warn", "all"],
41+
"block-scoped-var": "warn",
42+
"brace-style": ["warn", "1tbs"],
43+
44+
indent: ["warn", 2, {
45+
SwitchCase: 1,
46+
}],
47+
48+
"object-property-newline": "warn",
49+
50+
"object-curly-newline": ["warn", {
51+
ObjectExpression: {
52+
multiline: true,
53+
minProperties: 1,
54+
},
55+
56+
ObjectPattern: {
57+
multiline: true,
58+
minProperties: 3,
59+
},
60+
}],
61+
62+
"key-spacing": ["warn", {
63+
singleLine: {
64+
beforeColon: false,
65+
afterColon: true,
66+
},
67+
68+
multiLine: {
69+
beforeColon: false,
70+
afterColon: true,
71+
},
72+
}],
73+
74+
"no-dupe-keys": "warn",
75+
"no-dupe-class-members": "warn",
76+
77+
"no-unused-vars": ["warn", {
78+
args: "none",
79+
}],
80+
},
81+
}];
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import globals from "globals";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import js from "@eslint/js";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
7+
// eslint-disable-next-line no-underscore-dangle
8+
const __filename = fileURLToPath(import.meta.url);
9+
// eslint-disable-next-line no-underscore-dangle
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default [...compat.extends("qx"), {
18+
languageOptions: {
19+
globals: {
20+
...globals.browser,
21+
qx: false,
22+
q: false,
23+
qxWeb: false,
24+
osparc: false,
25+
explorer: false,
26+
Ajv: false,
27+
objectPath: false,
28+
},
29+
30+
ecmaVersion: 2017,
31+
sourceType: "script",
32+
},
33+
34+
rules: {
35+
camelcase: ["error", {
36+
properties: "always",
37+
}],
38+
39+
"no-underscore-dangle": ["error", {
40+
allowAfterThis: true,
41+
enforceInMethodNames: false,
42+
}],
43+
44+
"no-warning-comments": "off",
45+
"no-confusing-arrow": "off",
46+
"object-curly-newline": "off",
47+
48+
"newline-per-chained-call": ["error", {
49+
ignoreChainWithDepth: 3,
50+
}],
51+
52+
"no-eq-null": 0,
53+
semi: "off",
54+
"comma-dangle": "off",
55+
"object-curly-spacing": "off",
56+
"no-implicit-coercion": "off",
57+
"arrow-body-style": "off",
58+
},
59+
}];

tests/e2e/eslint.config.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import globals from "globals";
2+
3+
export default [{
4+
languageOptions: {
5+
globals: {
6+
...globals.jest,
7+
...globals.node,
8+
...globals.browser,
9+
page: true,
10+
browser: true,
11+
context: true,
12+
jestPuppeteer: true,
13+
console: true,
14+
url: true,
15+
apiVersion: true,
16+
ourTimeout: true,
17+
},
18+
},
19+
20+
rules: {
21+
"no-console": "off",
22+
},
23+
}];

0 commit comments

Comments
 (0)