Skip to content

Commit 0979357

Browse files
committed
update eslint config
1 parent fea355a commit 0979357

File tree

4 files changed

+64
-6
lines changed

4 files changed

+64
-6
lines changed

docs-svelte-kit/.env-cmdrc.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
module.exports = {
42
sveltekit: {
53
NODE_OPTIONS: `--import ./svelte-kit-import.mjs ${

docs-svelte-kit/eslint.config.mjs

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import * as myPlugin from '@ota-meshi/eslint-plugin';
2+
import globals from 'globals';
3+
4+
/**
5+
* @type {import('eslint').Linter.FlatConfig[]}
6+
*/
7+
const config = [
8+
{
9+
ignores: [
10+
'node_modules/',
11+
'.svelte-kit/',
12+
'build/',
13+
'shim/eslint.mjs',
14+
'shim/assert.mjs',
15+
'src/routes/*.md',
16+
'src/routes/**/*.md',
17+
'src/app.html'
18+
]
19+
},
20+
...myPlugin.config({
21+
eslintPlugin: true,
22+
ts: true,
23+
json: true,
24+
packageJson: true,
25+
yaml: true,
26+
md: true,
27+
prettier: true,
28+
svelte: { withTs: false }
29+
}),
30+
{
31+
languageOptions: {
32+
sourceType: 'module',
33+
globals: {
34+
...globals.browser,
35+
require: 'readonly'
36+
}
37+
}
38+
},
39+
{
40+
rules: {
41+
'jsdoc/require-jsdoc': 'off',
42+
'@typescript-eslint/no-shadow': 'off',
43+
'no-shadow': 'off',
44+
'@typescript-eslint/naming-convention': 'off',
45+
'new-cap': 'off',
46+
complexity: 'off',
47+
'n/no-missing-import': 'off',
48+
'n/file-extension-in-import': 'off',
49+
'n/no-extraneous-import': 'off'
50+
}
51+
},
52+
{
53+
files: ['**/*.svelte'],
54+
languageOptions: {
55+
parserOptions: { project: null }
56+
}
57+
}
58+
];
59+
export default config;

docs-svelte-kit/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "docs",
33
"private": true,
4+
"type": "commonjs",
45
"scripts": {
6+
"lint": "eslint --cache .",
7+
"lint-fix": "eslint --cache . --fix",
58
"build": "cd ../packages/eslint-plugin-svelte && pnpm build && cd ../../docs-svelte-kit && pnpm run svelte-kit build",
69
"preview": "pnpm run svelte-kit preview",
710
"dev": "pnpm run svelte-kit dev",
@@ -37,8 +40,8 @@
3740
"@types/postcss-safe-parser": "^5.0.4",
3841
"@types/prismjs": "^1.26.3",
3942
"@types/stylus": "^0.48.42",
40-
"@typescript-eslint/eslint-plugin": "^7.7.0",
41-
"@typescript-eslint/parser": "^7.7.0",
43+
"@typescript-eslint/eslint-plugin": "^7.9.0",
44+
"@typescript-eslint/parser": "^7.9.0",
4245
"@typescript/vfs": "^1.5.0",
4346
"acorn": "^8.11.3",
4447
"assert": "^2.1.0",
@@ -56,7 +59,6 @@
5659
"eslint-plugin-jsonc": "^2.15.1",
5760
"eslint-plugin-markdown": "^5.0.0",
5861
"eslint-plugin-mdx": "^3.1.5",
59-
"eslint-plugin-n": "^17.2.1",
6062
"eslint-plugin-node-dependencies": "^0.12.0",
6163
"eslint-plugin-prettier": "^5.1.3",
6264
"eslint-plugin-regexp": "^2.5.0",

docs-svelte-kit/svelte.config.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import path from 'path';
33
import fs from 'fs';
44
import { fileURLToPath } from 'url';
55

6-
// eslint-disable-next-line no-undef -- There seems to be a package that uses `self`.
76
if (typeof self === 'undefined') {
87
globalThis.self = globalThis;
98
}

0 commit comments

Comments
 (0)