From 90798b12e55044f4327d58e920a184de7e45d89d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 4 Nov 2024 19:55:27 +0100 Subject: [PATCH] Add ts parser and adjust config --- eslint.config.js | 30 ++++++++++++++++++++++++++++++ eslint.config.mjs | 16 ---------------- package.json | 8 ++++++-- 3 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 eslint.config.js delete mode 100644 eslint.config.mjs diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..23710a7da --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,30 @@ +import eslintPluginVue from 'eslint-plugin-vue' +import ts from 'typescript-eslint' + +export default ts.config( + ...ts.configs.recommended, + ...ts.configs.stylistic, + ...eslintPluginVue.configs['flat/essential'], + { + files: ['**/*.vue'], + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser' + } + } + }, + { + ignores: [ + '**/vendor/*', + '**/import-png.d.ts', + '**/chill.webpack.config.js' + ] + }, + { + rules: { + // override/add rules settings here, such as: + 'vue/multi-word-component-names': 'off', + '@typescript-eslint/no-require-imports': 'off' + } + } +) diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 0d1b6b49c..000000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import pluginVue from 'eslint-plugin-vue' - -export default [ - ...pluginVue.configs['flat/essential'], -/* { - languageOptions: { - parser: '@typescript-eslint/parser', - }, - },*/ - { - rules: { - // override/add rules settings here, such as: - 'vue/multi-word-component': 'off' - } - } -] diff --git a/package.json b/package.json index e57d8c68f..102d5bf06 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "type": "module", "name": "chill", "version": "2.0.0", "devDependencies": { @@ -13,15 +14,17 @@ "@ckeditor/ckeditor5-markdown-gfm": "^41.4.2", "@ckeditor/ckeditor5-theme-lark": "^41.4.2", "@ckeditor/ckeditor5-vue": "^5.1.0", + "@eslint/js": "^9.14.0", "@symfony/webpack-encore": "^4.1.0", "@tsconfig/node14": "^1.0.1", "@types/dompurify": "^3.0.5", + "@types/eslint__js": "^8.42.3", "@typescript-eslint/parser": "^8.12.2", "bindings": "^1.5.0", "bootstrap": "5.2.3", "chokidar": "^3.5.1", "dompurify": "^3.1.0", - "eslint": "^9.13.0", + "eslint": "^9.14.0", "eslint-plugin-vue": "^9.30.0", "fork-awesome": "^1.1.7", "jquery": "^3.6.0", @@ -35,7 +38,8 @@ "select2-bootstrap-theme": "0.1.0-beta.10", "style-loader": "^3.3.1", "ts-loader": "^9.3.1", - "typescript": "^5.4.5", + "typescript": "^5.6.3", + "typescript-eslint": "^8.13.0", "vue-loader": "^17.0.0", "webpack": "^5.75.0", "webpack-cli": "^5.0.1"