Skip to content

Commit 058d4b9

Browse files
committed
Fix ESLint
1 parent b51181b commit 058d4b9

File tree

3 files changed

+104
-103
lines changed

3 files changed

+104
-103
lines changed

eslint.config.mjs

+101-101
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2-
import globals from "globals";
3-
import tsParser from "@typescript-eslint/parser";
4-
import path from "node:path";
5-
import {fileURLToPath} from "node:url";
6-
import js from "@eslint/js";
7-
import {FlatCompat} from "@eslint/eslintrc";
1+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2+
import globals from 'globals';
3+
import tsParser from '@typescript-eslint/parser';
4+
import path from 'node:path';
5+
import {fileURLToPath} from 'node:url';
6+
import js from '@eslint/js';
7+
import {FlatCompat} from '@eslint/eslintrc';
88

99
const __filename = fileURLToPath(import.meta.url);
1010
const __dirname = path.dirname(__filename);
@@ -16,146 +16,146 @@ const compat = new FlatCompat({
1616

1717
export default [{
1818
ignores: [
19-
"src/vendor/**/*",
20-
"src/solid/**/*",
21-
"src/opus-recorder/**/*",
22-
"public/**/*",
23-
],
19+
'src/vendor/**/*',
20+
'src/solid/**/*',
21+
'src/opus-recorder/**/*',
22+
'public/**/*'
23+
]
2424
}, ...compat.extends(), {
2525
plugins: {
26-
"@typescript-eslint": typescriptEslint,
26+
'@typescript-eslint': typescriptEslint
2727
},
28-
28+
2929
languageOptions: {
3030
globals: {
31-
...globals.browser,
31+
...globals.browser
3232
},
33-
33+
3434
parser: tsParser,
35-
ecmaVersion: "latest",
36-
sourceType: "module",
37-
35+
ecmaVersion: 'latest',
36+
sourceType: 'module',
37+
3838
parserOptions: {
39-
project: ["./tsconfig.json"],
40-
},
39+
project: ['./tsconfig.json']
40+
}
4141
},
42-
42+
4343
rules: {
44-
"max-len": "off",
45-
46-
"keyword-spacing": ["error", {
44+
'max-len': 'off',
45+
46+
'keyword-spacing': ['error', {
4747
after: true,
48-
48+
4949
overrides: {
5050
if: {
5151
before: true,
52-
after: false,
52+
after: false
5353
},
54-
54+
5555
else: {
56-
before: true,
56+
before: true
5757
},
58-
58+
5959
catch: {
6060
before: true,
61-
after: false,
61+
after: false
6262
},
63-
63+
6464
for: {
65-
after: false,
65+
after: false
6666
},
67-
67+
6868
while: {
69-
after: false,
69+
after: false
7070
},
71-
71+
7272
switch: {
73-
after: false,
74-
},
75-
},
73+
after: false
74+
}
75+
}
7676
}],
77-
78-
"linebreak-style": ["error", "unix"],
79-
"eol-last": "error",
80-
81-
indent: ["error", 2, {
77+
78+
'linebreak-style': ['error', 'unix'],
79+
'eol-last': 'error',
80+
81+
'indent': ['error', 2, {
8282
CallExpression: {
83-
arguments: 1,
83+
arguments: 1
8484
},
85-
85+
8686
FunctionDeclaration: {
8787
body: 1,
88-
parameters: 1,
88+
parameters: 1
8989
},
90-
90+
9191
FunctionExpression: {
9292
body: 1,
93-
parameters: 1,
93+
parameters: 1
9494
},
95-
95+
9696
MemberExpression: 0,
9797
ObjectExpression: 1,
9898
SwitchCase: 1,
99-
ignoredNodes: ["ConditionalExpression"],
99+
ignoredNodes: ['ConditionalExpression']
100100
}],
101-
102-
"space-before-function-paren": ["error", "never"],
103-
"prefer-promise-reject-errors": "off",
104-
curly: "off",
105-
"comma-dangle": ["error", "never"],
106-
"comma-spacing": "error",
107-
"comma-style": "error",
108-
"quote-props": ["error", "consistent"],
109-
110-
quotes: ["error", "single", {
111-
allowTemplateLiterals: true,
101+
102+
'space-before-function-paren': ['error', 'never'],
103+
'prefer-promise-reject-errors': 'off',
104+
'curly': 'off',
105+
'comma-dangle': ['error', 'never'],
106+
'comma-spacing': 'error',
107+
'comma-style': 'error',
108+
'quote-props': ['error', 'consistent'],
109+
110+
'quotes': ['error', 'single', {
111+
allowTemplateLiterals: true
112112
}],
113-
114-
"space-before-blocks": ["error", "always"],
115-
"spaced-comment": ["error", "always"],
116-
"prefer-spread": "off",
117-
118-
"prefer-const": ["error", {
119-
destructuring: "all",
113+
114+
'space-before-blocks': ['error', 'always'],
115+
'spaced-comment': ['error', 'always'],
116+
'prefer-spread': 'off',
117+
118+
'prefer-const': ['error', {
119+
destructuring: 'all'
120120
}],
121-
122-
"object-curly-spacing": ["error", "never"],
123-
"array-bracket-spacing": ["error", "never"],
124-
"switch-colon-spacing": "error",
125-
"operator-linebreak": ["error", "after"],
126-
"padded-blocks": ["error", "never"],
127-
"no-useless-call": "error",
128-
"no-trailing-spaces": "error",
129-
"no-mixed-spaces-and-tabs": "error",
130-
131-
"no-multiple-empty-lines": ["error", {
132-
max: 2,
121+
122+
'object-curly-spacing': ['error', 'never'],
123+
'array-bracket-spacing': ['error', 'never'],
124+
'switch-colon-spacing': 'error',
125+
'operator-linebreak': ['error', 'after'],
126+
'padded-blocks': ['error', 'never'],
127+
'no-useless-call': 'error',
128+
'no-trailing-spaces': 'error',
129+
'no-mixed-spaces-and-tabs': 'error',
130+
131+
'no-multiple-empty-lines': ['error', {
132+
max: 2
133133
}],
134-
135-
"no-tabs": "error",
136-
"no-multi-str": "error",
137-
"no-new-wrappers": "error",
138-
139-
"no-irregular-whitespace": ["error", {
134+
135+
'no-tabs': 'error',
136+
'no-multi-str': 'error',
137+
'no-new-wrappers': 'error',
138+
139+
'no-irregular-whitespace': ['error', {
140140
skipStrings: true,
141141
skipComments: true,
142142
skipRegExps: true,
143-
skipTemplates: true,
143+
skipTemplates: true
144144
}],
145-
146-
"no-unexpected-multiline": "error",
147-
"no-return-await": "error",
148-
"@typescript-eslint/await-thenable": "error",
149-
},
145+
146+
'no-unexpected-multiline': 'error',
147+
'no-return-await': 'error',
148+
'@typescript-eslint/await-thenable': 'error'
149+
}
150150
}, {
151-
files: ["**/*.ts"],
152-
151+
files: ['**/*.ts'],
152+
153153
languageOptions: {
154154
ecmaVersion: 5,
155-
sourceType: "script",
156-
155+
sourceType: 'script',
156+
157157
parserOptions: {
158-
project: ["./tsconfig.json"],
159-
},
160-
},
161-
}];
158+
project: ['./tsconfig.json']
159+
}
160+
}
161+
}];

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"tinyld": "^1.3.4",
6363
"typescript": "^5.7.3",
6464
"vite": "^5.2.10",
65-
"vite-plugin-checker": "^0.6.2",
65+
"vite-plugin-checker": "^0.8.0",
6666
"vite-plugin-handlebars": "^1.6.0",
6767
"vite-plugin-solid": "^2.8.0",
6868
"vitest": "^0.34.6"

vite.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export default defineConfig({
6363
typescript: true,
6464
eslint: {
6565
// for example, lint .ts and .tsx
66-
lintCommand: 'eslint "./src/**/*.{ts,tsx}" --ignore-pattern "/src/solid/*"'
66+
lintCommand: 'eslint "./src/**/*.{ts,tsx}" --ignore-pattern "/src/solid/*"',
67+
useFlatConfig: true
6768
}
6869
}),
6970
solidPlugin(),

0 commit comments

Comments
 (0)