Skip to content

Commit 8b3c6ae

Browse files
committed
chore: migrate eslint config
1 parent 1bf4a33 commit 8b3c6ae

21 files changed

+238
-241
lines changed

.devcontainer/devcontainer.json

+18-21
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/javascript-node
33
{
4-
"name": "Node.js",
5-
"build": {
6-
"dockerfile": "Dockerfile",
7-
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
8-
// Append -bullseye or -buster to pin to an OS version.
9-
// Use -bullseye variants on local arm64/Apple Silicon.
10-
"args": { "VARIANT": "16-bullseye" }
11-
},
4+
"name": "Node.js",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
8+
// Append -bullseye or -buster to pin to an OS version.
9+
// Use -bullseye variants on local arm64/Apple Silicon.
10+
"args": { "VARIANT": "16-bullseye" }
11+
},
1212

13-
// Set *default* container specific settings.json values on container create.
14-
"settings": {},
13+
// Set *default* container specific settings.json values on container create.
14+
"settings": {},
1515

16-
// Add the IDs of extensions you want installed when the container is created.
17-
"extensions": [
18-
"dbaeumer.vscode-eslint",
19-
"svelte.svelte-vscode"
20-
],
16+
// Add the IDs of extensions you want installed when the container is created.
17+
"extensions": ["dbaeumer.vscode-eslint", "svelte.svelte-vscode"],
2118

22-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
23-
// "forwardPorts": [],
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
// "forwardPorts": [],
2421

25-
// Use 'postCreateCommand' to run commands after the container is created.
26-
"postCreateCommand": "pnpm install",
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
"postCreateCommand": "pnpm install",
2724

28-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
29-
"remoteUser": "node"
25+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
26+
"remoteUser": "node"
3027
}

.eslintignore

-18
This file was deleted.

.eslintrc-for-playground.js

-16
This file was deleted.

.eslintrc.js

-88
This file was deleted.

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"editor.codeActionsOnSave": {
1616
"source.fixAll.eslint": "explicit"
1717
},
18-
"vetur.validation.template": false
18+
"eslint.enable": true
1919
}

benchmark/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable-next-line eslint-comments/disable-enable-pair -- ignore
1+
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -- ignore
22
/* eslint-disable no-console -- ignore */
33
import * as Benchmark from "benchmark";
44
import fs from "fs";

eslint.config.mjs

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
import * as myPlugin from "@ota-meshi/eslint-plugin";
2+
import globals from "globals";
3+
4+
export default [
5+
{
6+
ignores: [
7+
".nyc_output",
8+
"coverage",
9+
"lib",
10+
"node_modules",
11+
"tests/fixtures/**/*.json",
12+
"tests/fixtures/**/*.svelte",
13+
"tests/fixtures/**/*.js",
14+
"tests/fixtures/**/*.ts",
15+
"explorer/dist",
16+
"explorer/node_modules",
17+
"explorer-v2/build",
18+
"explorer-v2/build",
19+
"explorer-v2/build-system/shim/svelte-eslint-parser.*",
20+
"explorer-v2/build-system/shim/eslint-scope.*",
21+
"explorer-v2/build-system/shim/eslint.*",
22+
"explorer-v2/build-system/shim/svelte/*",
23+
"!.vscode",
24+
"!.github",
25+
"explorer-v2/.svelte-kit",
26+
".changeset/pre.json",
27+
],
28+
},
29+
...myPlugin.config({
30+
node: true,
31+
ts: true,
32+
json: true,
33+
packageJson: true,
34+
yaml: true,
35+
prettier: true,
36+
}),
37+
{
38+
languageOptions: {
39+
sourceType: "module",
40+
},
41+
42+
rules: {
43+
"no-lonely-if": "off",
44+
"no-shadow": "off",
45+
"@typescript-eslint/no-shadow": "off",
46+
"no-warning-comments": "warn",
47+
"jsdoc/require-jsdoc": "off",
48+
complexity: "off",
49+
50+
"prettier/prettier": [
51+
"error",
52+
{},
53+
{
54+
usePrettierrc: true,
55+
},
56+
],
57+
},
58+
},
59+
{
60+
files: ["**/*.ts"],
61+
62+
languageOptions: {
63+
parserOptions: {
64+
project: "./tsconfig.json",
65+
},
66+
},
67+
68+
rules: {
69+
"@typescript-eslint/naming-convention": [
70+
"error",
71+
{
72+
selector: "default",
73+
format: ["camelCase"],
74+
leadingUnderscore: "allow",
75+
trailingUnderscore: "allow",
76+
},
77+
{
78+
selector: "variable",
79+
format: ["camelCase", "UPPER_CASE"],
80+
leadingUnderscore: "allow",
81+
trailingUnderscore: "allow",
82+
},
83+
{
84+
selector: "typeLike",
85+
format: ["PascalCase"],
86+
},
87+
{
88+
selector: "property",
89+
format: null,
90+
},
91+
{
92+
selector: "method",
93+
format: null,
94+
},
95+
{
96+
selector: "import",
97+
format: ["camelCase", "PascalCase", "UPPER_CASE"],
98+
},
99+
],
100+
101+
"@typescript-eslint/no-non-null-assertion": "off",
102+
"@typescript-eslint/no-use-before-define": "off",
103+
"@typescript-eslint/no-explicit-any": "off",
104+
"no-implicit-globals": "off",
105+
106+
"no-void": [
107+
"error",
108+
{
109+
allowAsStatement: true,
110+
},
111+
],
112+
},
113+
},
114+
{
115+
files: ["scripts/**/*.ts", "tests/**/*.ts"],
116+
117+
rules: {
118+
"no-console": "off",
119+
"jsdoc/require-jsdoc": "off",
120+
},
121+
},
122+
123+
...myPlugin
124+
.config({
125+
prettier: true,
126+
svelte: true,
127+
})
128+
.map(async (config) => ({
129+
...(await config),
130+
files: ["explorer-v2/**/*.svelte"],
131+
})),
132+
{
133+
files: ["explorer-v2/**/*.{svelte,js}"],
134+
languageOptions: {
135+
globals: {
136+
...globals.browser,
137+
},
138+
},
139+
rules: {
140+
"eslint-comments/no-unused-disable": "off",
141+
"n/no-missing-import": "off",
142+
"n/no-unpublished-require": "off",
143+
"n/no-unpublished-import": "off",
144+
"n/no-unsupported-features/es-syntax": "off",
145+
"n/no-unsupported-features/node-builtins": "off",
146+
"require-jsdoc": "off",
147+
"n/file-extension-in-import": "off",
148+
149+
"prettier/prettier": [
150+
"error",
151+
{},
152+
{
153+
usePrettierrc: true,
154+
},
155+
],
156+
157+
"no-shadow": "off",
158+
camelcase: "off",
159+
},
160+
},
161+
{
162+
files: ["**/*.d.ts"],
163+
rules: {
164+
"spaced-comment": "off",
165+
},
166+
},
167+
];

0 commit comments

Comments
 (0)