From 04fc07a27d16edb73d4390aac01b909fa7beb2de Mon Sep 17 00:00:00 2001 From: Jeremiasz Major Date: Sun, 7 Apr 2024 18:46:15 +0200 Subject: [PATCH] bump eslint and plugin versions --- .../+eslint+prettier+typescript/.eslintrc.cjs | 31 ------------------- .../eslint.config.js | 31 +++++++++++++++++++ .../+eslint+prettier-typescript/.eslintrc.cjs | 15 --------- .../eslint.config.js | 21 +++++++++++++ .../shared/+eslint+typescript/.eslintrc.cjs | 30 ------------------ .../+eslint+typescript/eslint.config.js | 29 +++++++++++++++++ .../shared/+eslint-typescript/.eslintrc.cjs | 15 --------- .../+eslint-typescript/eslint.config.js | 19 ++++++++++++ .../create-svelte/shared/+eslint/package.json | 3 +- 9 files changed, 102 insertions(+), 92 deletions(-) delete mode 100644 packages/create-svelte/shared/+eslint+prettier+typescript/.eslintrc.cjs create mode 100644 packages/create-svelte/shared/+eslint+prettier+typescript/eslint.config.js delete mode 100644 packages/create-svelte/shared/+eslint+prettier-typescript/.eslintrc.cjs create mode 100644 packages/create-svelte/shared/+eslint+prettier-typescript/eslint.config.js delete mode 100644 packages/create-svelte/shared/+eslint+typescript/.eslintrc.cjs create mode 100644 packages/create-svelte/shared/+eslint+typescript/eslint.config.js delete mode 100644 packages/create-svelte/shared/+eslint-typescript/.eslintrc.cjs create mode 100644 packages/create-svelte/shared/+eslint-typescript/eslint.config.js diff --git a/packages/create-svelte/shared/+eslint+prettier+typescript/.eslintrc.cjs b/packages/create-svelte/shared/+eslint+prettier+typescript/.eslintrc.cjs deleted file mode 100644 index 0b757582c066..000000000000 --- a/packages/create-svelte/shared/+eslint+prettier+typescript/.eslintrc.cjs +++ /dev/null @@ -1,31 +0,0 @@ -/** @type { import("eslint").Linter.Config } */ -module.exports = { - root: true, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:svelte/recommended', - 'prettier' - ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - }, - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser' - } - } - ] -}; diff --git a/packages/create-svelte/shared/+eslint+prettier+typescript/eslint.config.js b/packages/create-svelte/shared/+eslint+prettier+typescript/eslint.config.js new file mode 100644 index 000000000000..b3fa071b0735 --- /dev/null +++ b/packages/create-svelte/shared/+eslint+prettier+typescript/eslint.config.js @@ -0,0 +1,31 @@ +import js from '@eslint/js'; +import ts from 'typescript-eslint'; +import svelte from 'eslint-plugin-svelte'; +import prettier from 'eslint-config-prettier'; +import globals from 'globals'; + +/** @type { import("eslint").Linter.FlatConfig[] } */ +export default [ + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs['flat/recommended'], + prettier, + { + languageOptions: { + ecmaVersion: 2020, + globals: { + ...globals.browser, + ...globals.es2017, + ...globals.node + } + } + }, + { + files: ['**/*.svelte'], + languageOptions: { + parserOptions: { + parser: ts.parser + } + } + } +]; diff --git a/packages/create-svelte/shared/+eslint+prettier-typescript/.eslintrc.cjs b/packages/create-svelte/shared/+eslint+prettier-typescript/.eslintrc.cjs deleted file mode 100644 index 50b97a54680b..000000000000 --- a/packages/create-svelte/shared/+eslint+prettier-typescript/.eslintrc.cjs +++ /dev/null @@ -1,15 +0,0 @@ -/** @type { import("eslint").Linter.Config } */ -module.exports = { - root: true, - extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - } -}; diff --git a/packages/create-svelte/shared/+eslint+prettier-typescript/eslint.config.js b/packages/create-svelte/shared/+eslint+prettier-typescript/eslint.config.js new file mode 100644 index 000000000000..aac454190ee6 --- /dev/null +++ b/packages/create-svelte/shared/+eslint+prettier-typescript/eslint.config.js @@ -0,0 +1,21 @@ +import js from '@eslint/js'; +import svelte from 'eslint-plugin-svelte'; +import prettier from 'eslint-config-prettier'; +import globals from 'globals'; + +/** @type { import("eslint").Linter.FlatConfig[] } */ +export default [ + js.configs.recommended, + ...svelte.configs['flat/recommended'], + prettier, + { + languageOptions: { + ecmaVersion: 2020, + globals: { + ...globals.browser, + ...globals.es2017, + ...globals.node + } + } + } +]; diff --git a/packages/create-svelte/shared/+eslint+typescript/.eslintrc.cjs b/packages/create-svelte/shared/+eslint+typescript/.eslintrc.cjs deleted file mode 100644 index 419521f727e7..000000000000 --- a/packages/create-svelte/shared/+eslint+typescript/.eslintrc.cjs +++ /dev/null @@ -1,30 +0,0 @@ -/** @type { import("eslint").Linter.Config } */ -module.exports = { - root: true, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:svelte/recommended' - ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - }, - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser' - } - } - ] -}; diff --git a/packages/create-svelte/shared/+eslint+typescript/eslint.config.js b/packages/create-svelte/shared/+eslint+typescript/eslint.config.js new file mode 100644 index 000000000000..78be77b2aa4c --- /dev/null +++ b/packages/create-svelte/shared/+eslint+typescript/eslint.config.js @@ -0,0 +1,29 @@ +import js from '@eslint/js'; +import ts from 'typescript-eslint'; +import svelte from 'eslint-plugin-svelte'; +import globals from 'globals'; + +/** @type { import("eslint").Linter.FlatConfig[] } */ +export default [ + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs['flat/recommended'], + { + languageOptions: { + ecmaVersion: 2020, + globals: { + ...globals.browser, + ...globals.es2017, + ...globals.node + } + } + }, + { + files: ['**/*.svelte'], + languageOptions: { + parserOptions: { + parser: ts.parser + } + } + } +]; diff --git a/packages/create-svelte/shared/+eslint-typescript/.eslintrc.cjs b/packages/create-svelte/shared/+eslint-typescript/.eslintrc.cjs deleted file mode 100644 index 702ea973b33e..000000000000 --- a/packages/create-svelte/shared/+eslint-typescript/.eslintrc.cjs +++ /dev/null @@ -1,15 +0,0 @@ -/** @type { import("eslint").Linter.Config } */ -module.exports = { - root: true, - extends: ['eslint:recommended', 'plugin:svelte/recommended'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - } -}; diff --git a/packages/create-svelte/shared/+eslint-typescript/eslint.config.js b/packages/create-svelte/shared/+eslint-typescript/eslint.config.js new file mode 100644 index 000000000000..7b12eeac684b --- /dev/null +++ b/packages/create-svelte/shared/+eslint-typescript/eslint.config.js @@ -0,0 +1,19 @@ +import js from '@eslint/js'; +import svelte from 'eslint-plugin-svelte'; +import globals from 'globals'; + +/** @type { import("eslint").Linter.FlatConfig[] } */ +export default [ + js.configs.recommended, + ...svelte.configs['flat/recommended'], + { + languageOptions: { + ecmaVersion: 2020, + globals: { + ...globals.browser, + ...globals.es2017, + ...globals.node + } + } + } +]; diff --git a/packages/create-svelte/shared/+eslint/package.json b/packages/create-svelte/shared/+eslint/package.json index 2aa03d1cffd6..ca89d8988c9f 100644 --- a/packages/create-svelte/shared/+eslint/package.json +++ b/packages/create-svelte/shared/+eslint/package.json @@ -2,6 +2,7 @@ "devDependencies": { "@types/eslint": "^8.56.7", "eslint": "^9.0.0", - "eslint-plugin-svelte": "^2.36.0-next.13" + "eslint-plugin-svelte": "^2.36.0-next.13", + "globals": "^15.0.0" } }