mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add prettier to eslint to format vue, js and ts code + add script to run it locally
This commit is contained in:
parent
9d9f062417
commit
610227815a
@ -1,30 +1,35 @@
|
|||||||
import eslintPluginVue from 'eslint-plugin-vue'
|
import eslintPluginVue from "eslint-plugin-vue";
|
||||||
import ts from 'typescript-eslint'
|
import ts from "typescript-eslint";
|
||||||
|
import eslintPluginPrettier from "eslint-plugin-prettier";
|
||||||
|
|
||||||
export default ts.config(
|
export default ts.config(
|
||||||
...ts.configs.recommended,
|
...ts.configs.recommended,
|
||||||
...ts.configs.stylistic,
|
...ts.configs.stylistic,
|
||||||
...eslintPluginVue.configs['flat/essential'],
|
...eslintPluginVue.configs["flat/essential"],
|
||||||
{
|
{
|
||||||
files: ['**/*.vue'],
|
files: ["**/*.vue"],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
parser: '@typescript-eslint/parser'
|
parser: "@typescript-eslint/parser",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: [
|
||||||
'**/vendor/*',
|
"**/vendor/*",
|
||||||
'**/import-png.d.ts',
|
"**/import-png.d.ts",
|
||||||
'**/chill.webpack.config.js'
|
"**/chill.webpack.config.js",
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
plugins: {
|
||||||
|
prettier: eslintPluginPrettier,
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
"prettier/prettier": "error",
|
||||||
// override/add rules settings here, such as:
|
// override/add rules settings here, such as:
|
||||||
'vue/multi-word-component-names': 'off',
|
"vue/multi-word-component-names": "off",
|
||||||
'@typescript-eslint/no-require-imports': 'off'
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
"chokidar": "^3.5.1",
|
"chokidar": "^3.5.1",
|
||||||
"dompurify": "^3.1.0",
|
"dompurify": "^3.1.0",
|
||||||
"eslint": "^9.14.0",
|
"eslint": "^9.14.0",
|
||||||
|
"eslint-config-prettier": "^9.1.0",
|
||||||
|
"eslint-plugin-prettier": "^5.2.1",
|
||||||
"eslint-plugin-vue": "^9.30.0",
|
"eslint-plugin-vue": "^9.30.0",
|
||||||
"fork-awesome": "^1.1.7",
|
"fork-awesome": "^1.1.7",
|
||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
@ -31,6 +33,7 @@
|
|||||||
"node-sass": "^8.0.0",
|
"node-sass": "^8.0.0",
|
||||||
"popper.js": "^1.16.1",
|
"popper.js": "^1.16.1",
|
||||||
"postcss-loader": "^7.0.2",
|
"postcss-loader": "^7.0.2",
|
||||||
|
"prettier": "^3.3.3",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"sass-loader": "^14.0.0",
|
"sass-loader": "^14.0.0",
|
||||||
"select2": "^4.0.13",
|
"select2": "^4.0.13",
|
||||||
@ -74,6 +77,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev-server": "encore dev-server",
|
"dev-server": "encore dev-server",
|
||||||
"dev": "encore dev",
|
"dev": "encore dev",
|
||||||
|
"prettier": "prettier --write \"**/*.{js,ts,vue}\"",
|
||||||
"watch": "encore dev --watch",
|
"watch": "encore dev --watch",
|
||||||
"build": "encore production --progress"
|
"build": "encore production --progress"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user