Skip to content

Commit ab3b35e

Browse files
committed
fix eslint in the root
1 parent f5bf86c commit ab3b35e

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import javascript from '@eslint/js'
2-
import typescript from 'typescript-eslint'
32
import globals from 'globals'
3+
import typescript from 'typescript-eslint'
44

55
export default [
66
{
77
plugins: {
88
typescript,
99
},
1010

11-
ignores: ['public/build/*'],
11+
ignores: ['public/build/*', 'packages/components/dist/*'],
1212

1313
languageOptions: {
1414
globals: {

packages/components/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ coverage
2323
*.njsproj
2424
*.sln
2525
*.sw?
26+
27+
package-lock.json
28+
*.tgz
29+
.vscode
30+
*.parquet
31+
/coverage/

packages/components/eslint.config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import globals from 'globals'
55
import tseslint from 'typescript-eslint'
66

77
export default tseslint.config(
8-
{ ignores: ['coverage', 'dist'] },
8+
{ ignores: ['coverage/', 'dist/'] },
99
{
1010
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11-
files: ['**/*.{ts,tsx}'],
11+
files: ['**/*.{ts,tsx,js}'],
1212
languageOptions: {
1313
ecmaVersion: 2020,
1414
globals: globals.browser,
@@ -38,8 +38,8 @@ export default tseslint.config(
3838
'no-extra-parens': 'error',
3939
'no-multi-spaces': 'error',
4040
'no-trailing-spaces': 'error',
41-
"no-unused-vars": "off",
42-
"@typescript-eslint/no-unused-vars": 'warn',
41+
'no-unused-vars': 'off',
42+
'@typescript-eslint/no-unused-vars': 'warn',
4343
'no-useless-concat': 'error',
4444
'no-useless-rename': 'error',
4545
'no-useless-return': 'error',
@@ -65,11 +65,13 @@ export default tseslint.config(
6565
},
6666
},
6767
{
68-
files: ['test/**/*.{ts,tsx}', '*.ts'],
68+
files: ['test/**/*.{ts,tsx}', '*.{js,ts}'],
6969
languageOptions: {
7070
ecmaVersion: 2020,
71-
globals: globals.browser,
72-
globals: globals.node,
73-
}
74-
}
71+
globals: {
72+
...globals.node,
73+
...globals.browser,
74+
},
75+
},
76+
},
7577
)

src/serve.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async function handleListing(prefix) {
185185
try {
186186
const stat = await fs.stat(prefix)
187187
if (!stat.isDirectory()) return { status: 400, content: 'not a directory' }
188-
} catch (error) {
188+
} catch {
189189
return { status: 404, content: 'not found' }
190190
}
191191

@@ -232,7 +232,8 @@ function startServer(port, path) {
232232
} catch (err) {
233233
console.error('error handling request', err)
234234
}
235-
let { status, content } = result
235+
const { status } = result
236+
let { content } = result
236237

237238
// write http header
238239
/** @type {http.OutgoingHttpHeaders} */

0 commit comments

Comments
 (0)