-
Notifications
You must be signed in to change notification settings - Fork 589
/
eslint.config.mjs
57 lines (51 loc) · 1.46 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
import globals from "globals";
import js from "@eslint/js";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import importPlugin from "eslint-plugin-import";
export default [
js.configs.recommended,
eslintPluginPrettierRecommended,
importPlugin.flatConfigs.recommended,
// Ignore machine-generated files
{
ignores: [
"packages/font-glyphs/**/*.mjs",
"packages/font-otl/**/*.mjs",
"packages/font/src/generated/ttfa-ranges.mjs", // Machine-generated
],
},
// Main monorepo
{
files: ["packages/*/src/**/*.mjs", "tools/*/src/**/*.mjs", "verdafile.mjs"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.node,
...globals.nodeBuiltin,
...globals.es2021,
},
},
rules: {
semi: ["error", "always"],
"no-var": "error",
"no-console": 0,
"no-constant-condition": ["error", { checkLoops: false }],
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"no-unused-vars": ["off"],
complexity: ["warn", 16],
// eslint-import rules
"import/no-unresolved": "off", // ESLint does not support subpath exports, but we do
"import/no-extraneous-dependencies": "error",
"import/newline-after-import": ["error", { count: 1 }],
"import/order": [
"error",
{
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "always",
alphabetize: { order: "asc", caseInsensitive: true },
},
],
},
},
];