-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (82 loc) · 2.29 KB
/
Copy patheslint.config.js
File metadata and controls
84 lines (82 loc) · 2.29 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { defineConfig } from "eslint/config";
import globals from "globals";
import js from "@eslint/js";
import json from "@eslint/json";
import jsonc from "eslint-plugin-jsonc";
import markdown from "@eslint/markdown";
import css from "@eslint/css";
import eslintConfigPrettier from "eslint-config-prettier/flat";
export default defineConfig([
{
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/coverage/**",
".yarn/**",
".cache/**",
"CHANGELOG.md",
],
},
{
files: ["**/*.js"],
plugins: { js },
extends: ["js/recommended"],
languageOptions: { globals: globals.node },
},
{
files: ["**/templates/*.js"],
plugins: { js },
extends: ["js/recommended"],
languageOptions: { globals: globals.browser },
},
{
files: ["**/(!package).json"],
plugins: { json },
language: "json/json",
extends: ["json/recommended"],
rules: {
"json/sort-keys": [
"warn",
"asc",
{
natural: true,
}
],
},
},
{
files: ["**/package.json"],
plugins: { jsonc },
language: "jsonc/jsonc",
extends: ["jsonc/recommended-with-json"],
rules: {
"jsonc/sort-keys": [
"warn",
{
pathPattern: "^$",
order: ["$schema", "private", "publishConfig", "name", "version", "description", "license", "author", "maintainers", "contributors", "homepage", "funding", "repository", "bugs", "type", "exports", "main", "module", "browser", "man", "preferGlobal", "bin", "files", "directories", "scripts", "config", "sideEffects", "types", "typings", "workspaces", "resolutions", "dependencies", "bundleDependencies", "bundledDependencies", "peerDependencies", "peerDependenciesMeta", "optionalDependencies", "devDependencies", "keywords", "engines", "engineStrict", "os", "cpu", "*", "packageManager"],
},
{ pathPattern: "^repository$", order: ["type", "url", "directory"] },
{ pathPattern: "^vague$", order: { type: "asc" } },
{ pathPattern: "^exports$", order: ["."] },
{ pathPattern: ".*", order: { type: "asc" } },
],
},
},
{
files: ["**/*.md"],
plugins: { markdown },
language: "markdown/gfm",
extends: ["markdown/recommended"],
},
{
files: ["**/*.css"],
plugins: { css },
language: "css/css",
extends: ["css/recommended"],
rules: {
"css/use-baseline": ["error", { available: "newly" }],
},
},
eslintConfigPrettier,
]);