update eslint config
This commit is contained in:
73
.eslint.cjs
73
.eslint.cjs
@ -1,73 +0,0 @@
|
|||||||
const { defineConfig, globalIgnores } = require('eslint/config');
|
|
||||||
|
|
||||||
const tsParser = require('@typescript-eslint/parser');
|
|
||||||
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
|
|
||||||
const parser = require('svelte-eslint-parser');
|
|
||||||
const globals = require('globals');
|
|
||||||
const js = require('@eslint/js');
|
|
||||||
|
|
||||||
const { FlatCompat } = require('@eslint/eslintrc');
|
|
||||||
|
|
||||||
const compat = new FlatCompat({
|
|
||||||
baseDirectory: __dirname,
|
|
||||||
recommendedConfig: js.configs.recommended,
|
|
||||||
allConfig: js.configs.all
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = defineConfig([
|
|
||||||
{
|
|
||||||
languageOptions: {
|
|
||||||
parser: tsParser,
|
|
||||||
sourceType: 'module',
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
|
|
||||||
parserOptions: {
|
|
||||||
extraFileExtensions: ['.svelte']
|
|
||||||
},
|
|
||||||
|
|
||||||
globals: {
|
|
||||||
...globals.browser,
|
|
||||||
...globals.node
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
extends: compat.extends(
|
|
||||||
'plugin:svelte/recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'prettier'
|
|
||||||
),
|
|
||||||
|
|
||||||
plugins: {
|
|
||||||
'@typescript-eslint': typescriptEslint
|
|
||||||
},
|
|
||||||
|
|
||||||
settings: {
|
|
||||||
'svelte3/typescript': () => require('typescript')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
globalIgnores(['**/*.cjs']),
|
|
||||||
{
|
|
||||||
files: ['**/*.svelte'],
|
|
||||||
|
|
||||||
languageOptions: {
|
|
||||||
parser: parser,
|
|
||||||
|
|
||||||
parserOptions: {
|
|
||||||
parser: '@typescript-eslint/parser'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
globalIgnores([
|
|
||||||
'**/.DS_Store',
|
|
||||||
'**/node_modules',
|
|
||||||
'build',
|
|
||||||
'.svelte-kit',
|
|
||||||
'package',
|
|
||||||
'**/.env',
|
|
||||||
'**/.env.*',
|
|
||||||
'!**/.env.example',
|
|
||||||
'**/pnpm-lock.yaml',
|
|
||||||
'**/package-lock.json',
|
|
||||||
'**/yarn.lock'
|
|
||||||
])
|
|
||||||
]);
|
|
29
.eslintrc.cjs
Normal file
29
.eslintrc.cjs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
extends: ['plugin:svelte/recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
|
||||||
|
plugins: ['@typescript-eslint'],
|
||||||
|
ignorePatterns: ['*.cjs'],
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.svelte'],
|
||||||
|
parser: 'svelte-eslint-parser',
|
||||||
|
parserOptions: {
|
||||||
|
parser: '@typescript-eslint/parser'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
settings: {
|
||||||
|
'svelte3/typescript': () => require('typescript')
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
sourceType: 'module',
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
extraFileExtensions: ['.svelte']
|
||||||
|
},
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es2017: true,
|
||||||
|
node: true
|
||||||
|
}
|
||||||
|
};
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"apexskier.eslint.config.eslintConfigPath" : ".eslintrc.cjs",
|
"apexskier.eslint.config.eslintConfigPath" : ".eslint.cjs",
|
||||||
"apexskier.eslint.config.eslintPath" : "node_modules\/@eslint\/eslintrc\/dist\/eslintrc.cjs",
|
|
||||||
"apexskier.eslint.config.fixOnSave" : "Enable",
|
"apexskier.eslint.config.fixOnSave" : "Enable",
|
||||||
"apexskier.typescript.config.formatDocumentOnSave" : "false",
|
"apexskier.typescript.config.formatDocumentOnSave" : "false",
|
||||||
"apexskier.typescript.config.isEnabledForJavascript" : "Enable",
|
"apexskier.typescript.config.isEnabledForJavascript" : "Enable",
|
||||||
|
73
eslint.config.cjs
Normal file
73
eslint.config.cjs
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
const {
|
||||||
|
defineConfig,
|
||||||
|
globalIgnores,
|
||||||
|
} = require("eslint/config");
|
||||||
|
|
||||||
|
const tsParser = require("@typescript-eslint/parser");
|
||||||
|
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
|
||||||
|
const parser = require("svelte-eslint-parser");
|
||||||
|
const globals = require("globals");
|
||||||
|
const js = require("@eslint/js");
|
||||||
|
|
||||||
|
const {
|
||||||
|
FlatCompat,
|
||||||
|
} = require("@eslint/eslintrc");
|
||||||
|
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
recommendedConfig: js.configs.recommended,
|
||||||
|
allConfig: js.configs.all
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = defineConfig([{
|
||||||
|
languageOptions: {
|
||||||
|
parser: tsParser,
|
||||||
|
sourceType: "module",
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
extraFileExtensions: [".svelte"],
|
||||||
|
},
|
||||||
|
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
extends: compat.extends(
|
||||||
|
"plugin:svelte/recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"prettier",
|
||||||
|
),
|
||||||
|
|
||||||
|
plugins: {
|
||||||
|
"@typescript-eslint": typescriptEslint,
|
||||||
|
},
|
||||||
|
|
||||||
|
settings: {
|
||||||
|
"svelte3/typescript": () => require("typescript"),
|
||||||
|
},
|
||||||
|
}, globalIgnores(["**/*.cjs"]), {
|
||||||
|
files: ["**/*.svelte"],
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
parser: parser,
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
parser: "@typescript-eslint/parser",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, globalIgnores([
|
||||||
|
"**/.DS_Store",
|
||||||
|
"**/node_modules",
|
||||||
|
"build",
|
||||||
|
".svelte-kit",
|
||||||
|
"package",
|
||||||
|
"**/.env",
|
||||||
|
"**/.env.*",
|
||||||
|
"!**/.env.example",
|
||||||
|
"**/pnpm-lock.yaml",
|
||||||
|
"**/package-lock.json",
|
||||||
|
"**/yarn.lock",
|
||||||
|
])]);
|
23
package-lock.json
generated
23
package-lock.json
generated
@ -27,7 +27,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||||
"@typescript-eslint/parser": "^8.0.0",
|
"@typescript-eslint/parser": "^8.0.0",
|
||||||
"@zerodevx/svelte-toast": "^0.9.3",
|
"@zerodevx/svelte-toast": "^0.9.3",
|
||||||
"eslint": "^9.11.1",
|
"eslint": "^9.30.1",
|
||||||
"eslint-config-prettier": "^10.0.0",
|
"eslint-config-prettier": "^10.0.0",
|
||||||
"eslint-plugin-svelte": "^3.0.0",
|
"eslint-plugin-svelte": "^3.0.0",
|
||||||
"globals": "^16.3.0",
|
"globals": "^16.3.0",
|
||||||
@ -2730,9 +2730,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "9.30.0",
|
"version": "9.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.30.1.tgz",
|
||||||
"integrity": "sha512-iN/SiPxmQu6EVkf+m1qpBxzUhE12YqFLOSySuOyVLJLEF9nzTf+h/1AJYc1JWzCnktggeNrjvQGLngDzXirU6g==",
|
"integrity": "sha512-zmxXPNMOXmwm9E0yQLi5uqXHs7uq2UIiqEKo3Gq+3fwo1XrJ+hijAZImyF7hclW3E6oHz43Yk3RP8at6OTKflQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -2742,7 +2742,7 @@
|
|||||||
"@eslint/config-helpers": "^0.3.0",
|
"@eslint/config-helpers": "^0.3.0",
|
||||||
"@eslint/core": "^0.14.0",
|
"@eslint/core": "^0.14.0",
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@eslint/js": "9.30.0",
|
"@eslint/js": "9.30.1",
|
||||||
"@eslint/plugin-kit": "^0.3.1",
|
"@eslint/plugin-kit": "^0.3.1",
|
||||||
"@humanfs/node": "^0.16.6",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
@ -2870,19 +2870,6 @@
|
|||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint/node_modules/@eslint/js": {
|
|
||||||
"version": "9.30.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.30.0.tgz",
|
|
||||||
"integrity": "sha512-Wzw3wQwPvc9sHM+NjakWTcPx11mbZyiYHuwWa/QfZ7cIRX7WK54PSk7bdyXDaoaopUcMatv1zaQvOAAO8hCdww==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://eslint.org/donate"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/eslint/node_modules/brace-expansion": {
|
"node_modules/eslint/node_modules/brace-expansion": {
|
||||||
"version": "1.1.12",
|
"version": "1.1.12",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||||
"@typescript-eslint/parser": "^8.0.0",
|
"@typescript-eslint/parser": "^8.0.0",
|
||||||
"@zerodevx/svelte-toast": "^0.9.3",
|
"@zerodevx/svelte-toast": "^0.9.3",
|
||||||
"eslint": "^9.11.1",
|
"eslint": "^9.30.1",
|
||||||
"eslint-config-prettier": "^10.0.0",
|
"eslint-config-prettier": "^10.0.0",
|
||||||
"eslint-plugin-svelte": "^3.0.0",
|
"eslint-plugin-svelte": "^3.0.0",
|
||||||
"globals": "^16.3.0",
|
"globals": "^16.3.0",
|
||||||
|
Reference in New Issue
Block a user