Updated eslint configuration

This commit is contained in:
Joan Sanchez 2022-02-25 13:12:14 +01:00
parent 25e8ed8a06
commit 01a9747339
13 changed files with 128 additions and 120 deletions

View File

@ -1,31 +1,31 @@
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
node: true, node: true,
},
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
}, },
], extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
},
],
}; };

6
.prettierrc.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
singleQuote: true,
printWidth: 120,
tabWidth: 4,
endOfLine: "auto",
};

View File

@ -1,16 +1,9 @@
{ {
"eslint.validate": [
"javascript",
"typescript",
"vue",
"html",
"scss",
"json",
],
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true, "source.fixAll.eslint": true,
}, },
"editor.bracketPairColorization.enabled": true, "editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true, "editor.guides.bracketPairs": true,
"files.eol": "\n", "files.eol": "\n",
"editor.tabSize": 4,
} }

View File

@ -1,3 +1,3 @@
module.exports = { module.exports = {
presets: ["@vue/cli-plugin-babel/preset"], presets: ['@vue/cli-plugin-babel/preset'],
}; };

View File

@ -1,3 +1,3 @@
{ {
"pluginsFile": "tests/e2e/plugins/index.js" "pluginsFile": "tests/e2e/plugins/index.js"
} }

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel", preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
transform: { transform: {
"^.+\\.vue$": "vue-jest", '^.+\\.vue$': 'vue-jest',
}, },
}; };

View File

@ -1,17 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="">
<head>
<head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title>
</head> <%= htmlWebpackPlugin.options.title %>
<body> </title>
</head>
<body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html>
</html>

View File

@ -1,12 +1,8 @@
import { createApp } from "vue"; import { createApp } from 'vue';
import App from "./App.vue"; import App from './App.vue';
import router from "./router"; import router from './router';
import store from "./store"; import store from './store';
import { Quasar } from "quasar"; import { Quasar } from 'quasar';
import quasarUserOptions from "./quasar-user-options"; import quasarUserOptions from './quasar-user-options';
createApp(App) createApp(App).use(Quasar, quasarUserOptions).use(store).use(router).mount('#app');
.use(Quasar, quasarUserOptions)
.use(store)
.use(router)
.mount("#app");

View File

@ -1,11 +1,11 @@
import "./styles/quasar.scss"; import './styles/quasar.scss';
import lang from "quasar/lang/es.js"; import lang from 'quasar/lang/es.js';
import "@quasar/extras/roboto-font/roboto-font.css"; import '@quasar/extras/roboto-font/roboto-font.css';
import "@quasar/extras/material-icons/material-icons.css"; import '@quasar/extras/material-icons/material-icons.css';
// To be used on app.use(Quasar, { ... }) // To be used on app.use(Quasar, { ... })
export default { export default {
config: {}, config: {},
plugins: {}, plugins: {},
lang: lang, lang: lang,
}; };

6
src/shims-vue.d.ts vendored
View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
declare module '*.vue' { declare module '*.vue' {
import type { DefineComponent } from 'vue' import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any> const component: DefineComponent<{}, {}, any>
export default component export default component
} }

View File

@ -1,8 +1,8 @@
import { createStore } from "vuex"; import { createStore } from 'vuex';
export default createStore({ export default createStore({
state: {}, state: {},
mutations: {}, mutations: {},
actions: {}, actions: {},
modules: {}, modules: {},
}); });

View File

@ -1,41 +1,41 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "esnext", "target": "esnext",
"module": "esnext", "module": "esnext",
"strict": true, "strict": true,
"jsx": "preserve", "jsx": "preserve",
"importHelpers": true, "importHelpers": true,
"moduleResolution": "node", "moduleResolution": "node",
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"sourceMap": true, "sourceMap": true,
"baseUrl": ".", "baseUrl": ".",
"types": [ "types": [
"webpack-env", "webpack-env",
"jest" "jest"
], ],
"paths": { "paths": {
"@/*": [ "@/*": [
"src/*" "src/*"
] ]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}, },
"lib": [ "include": [
"esnext", "src/**/*.ts",
"dom", "src/**/*.tsx",
"dom.iterable", "src/**/*.vue",
"scripthost" "tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
] ]
}, }
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}

View File

@ -1,9 +1,16 @@
module.exports = { module.exports = {
pluginOptions: { pluginOptions: {
quasar: { quasar: {
importStrategy: "kebab", importStrategy: 'kebab',
rtlSupport: false, rtlSupport: false,
},
}, },
}, css: {
transpileDependencies: ["quasar"], loaderOptions: {
sass: {
additionalData: `@import "@/styles/quasar.variables.scss";`,
},
},
},
transpileDependencies: ['quasar'],
}; };