add-prettier: Add prettier error in eslint

pull/448/head
maskeynihal 2023-10-12 11:44:09 +05:45
parent 86069a6e1e
commit 21d7b7b43e
6 changed files with 1053 additions and 60 deletions

View File

@ -1,13 +1,9 @@
module.exports = { module.exports = {
env: { env: {
'browser': true, browser: true,
'node': true, node: true,
}, },
extends: [ extends: ['eslint:recommended', 'plugin:vue/recommended', 'prettier'],
'eslint:recommended',
'plugin:vue/recommended',
'prettier',
],
parserOptions: { parserOptions: {
parser: '@babel/eslint-parser', parser: '@babel/eslint-parser',
ecmaVersion: 2018, ecmaVersion: 2018,
@ -23,20 +19,26 @@ module.exports = {
'vue/no-v-html': 0, 'vue/no-v-html': 0,
'vue/max-attributes-per-line': 0, 'vue/max-attributes-per-line': 0,
'vue/html-indent': ['error', 4], 'vue/html-indent': ['error', 4],
'vue/script-indent': ['error', 4, { 'vue/script-indent': [
'error',
4,
{
baseIndent: 1, baseIndent: 1,
switchCase: 1, switchCase: 1,
}], },
'vue/no-unused-vars': 0, ],
'vue/no-unused-vars': 'warn',
'vue/html-self-closing': 0, 'vue/html-self-closing': 0,
'vue/multi-word-component-names': 0, 'vue/multi-word-component-names': 0,
'vue/no-reserved-component-names': 0, 'vue/no-reserved-component-names': 0,
'eol-last': ['error', 'always'], 'eol-last': ['error', 'always'],
'prettier/prettier': 'error',
}, },
globals: { globals: {
'describe': true, describe: true,
'expect': true, expect: true,
'it': true, it: true,
'test': true, test: true,
}, },
plugins: ['prettier'],
}; };

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
package.json
package-lock.json

999
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,8 @@
"test:stylelint": "stylelint 'src/**/*.scss' --config node_modules/do-bulma/.stylelintrc.json", "test:stylelint": "stylelint 'src/**/*.scss' --config node_modules/do-bulma/.stylelintrc.json",
"test:i18n-packs": "node --es-module-specifier-resolution=node src/nginxconfig/i18n/verify.js", "test:i18n-packs": "node --es-module-specifier-resolution=node src/nginxconfig/i18n/verify.js",
"prepare": "husky install", "prepare": "husky install",
"prettier": "prettier --write 'src/**/*.{js,vue}'" "prettier": "prettier --write 'src/**/*.{js,vue}'",
"prettier:check": "prettier 'src/**/*.{js,vue}' --check"
}, },
"jest": { "jest": {
"testRegex": "/test/.*.js?$" "testRegex": "/test/.*.js?$"
@ -73,6 +74,7 @@
"duplicate-package-checker-webpack-plugin": "^3.0.0", "duplicate-package-checker-webpack-plugin": "^3.0.0",
"eslint": "^8.46.0", "eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-vue": "^9.16.1", "eslint-plugin-vue": "^9.16.1",
"esm": "^3.2.25", "esm": "^3.2.25",
"husky": "^8.0.3", "husky": "^8.0.3",

View File

@ -64,12 +64,12 @@ THE SOFTWARE.
return this.$data.scrolled && !this.$data.closed; return this.$data.scrolled && !this.$data.closed;
}, },
style() { style() {
return this.visible const nonVisibleStyle = {
? undefined
: {
opacity: 0, opacity: 0,
pointerEvents: 'none', pointerEvents: 'none',
}; };
return this.visible ? undefined : nonVisibleStyle;
}, },
}, },
mounted() { mounted() {