-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
65 lines (59 loc) · 1.92 KB
/
Copy patheslint.config.mjs
File metadata and controls
65 lines (59 loc) · 1.92 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
63
64
65
import js from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import { defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescript";
import skipFormattingConfig from "@vue/eslint-config-prettier/skip-formatting";
export default defineConfigWithVueTs(
{
name: "app/files-to-ignore",
ignores: ["dist/**", "node_modules/**"],
},
js.configs.recommended,
...pluginVue.configs["flat/recommended"],
vueTsConfigs.recommended,
{
files: ["**/*.{js,mjs,ts,vue}"],
rules: {
eqeqeq: "error",
curly: "error",
"no-console": ["warn", { allow: ["error", "warn"] }],
"no-debugger": "warn",
"no-var": "error",
"prefer-const": "error",
"prefer-template": "error",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
},
},
{
// ol is ESM with no exports map, so Node resolves a subpath as a literal
// file path. Bundlers guess the extension, Node does not, and what we
// publish has to resolve for consumers running outside a bundler.
// See https://github.com/openlayers/openlayers/issues/13114
name: "geo/ol-import-extensions",
files: ["**/*.{js,mjs,ts,vue}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
// Any ol subpath not ending in .js. A group glob cannot express
// this: gitignore semantics refuse to re-include a path whose
// parent the group already matched.
regex: "^ol/(?!.*\\.js$)",
message: "Import ol subpaths with their .js extension (ol/Map.js), or Node cannot resolve them.",
},
],
},
],
},
},
{
name: "geo/layer-model",
files: ["src/layers/types.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
// Must be last: turns off every rule that Prettier owns.
skipFormattingConfig,
);