diff --git a/eslint.config.mjs b/eslint.config.mjs index 23710a7da..6b6cd7439 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,30 +1,35 @@ -import eslintPluginVue from 'eslint-plugin-vue' -import ts from 'typescript-eslint' +import eslintPluginVue from "eslint-plugin-vue"; +import ts from "typescript-eslint"; +import eslintPluginPrettier from "eslint-plugin-prettier"; 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' - } - } -) + ...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", + ], + }, + { + plugins: { + prettier: eslintPluginPrettier, + }, + rules: { + "prettier/prettier": "error", + // override/add rules settings here, such as: + "vue/multi-word-component-names": "off", + "@typescript-eslint/no-require-imports": "off", + }, + }, +); diff --git a/package.json b/package.json index aff399b98..4f4879f3a 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "chokidar": "^3.5.1", "dompurify": "^3.1.0", "eslint": "^9.14.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-vue": "^9.30.0", "fork-awesome": "^1.1.7", "jquery": "^3.6.0", @@ -31,6 +33,7 @@ "node-sass": "^8.0.0", "popper.js": "^1.16.1", "postcss-loader": "^7.0.2", + "prettier": "^3.3.3", "raw-loader": "^4.0.2", "sass-loader": "^14.0.0", "select2": "^4.0.13", @@ -74,6 +77,7 @@ "scripts": { "dev-server": "encore dev-server", "dev": "encore dev", + "prettier": "prettier --write \"**/*.{js,ts,vue}\"", "watch": "encore dev --watch", "build": "encore production --progress" },