gxmari007 / vite-plugin-eslint

🚨 ESLint plugin for vite
MIT License
266 stars 44 forks source link

Upgrading from v1.3.0 to v1.5.0+ more than doubles build time #28

Closed iamrgroot closed 2 years ago

iamrgroot commented 2 years ago

I can't publish my full repository, but using v1.5.0 or newer results in a significant increase in build times. I can't use v1.4.0 because I'm using eslint v8.

(I'm using npm ci to make sure the caches from Vite are cleared)

npm i -D vite-plugin-eslint@~1.5 && npm ci && time npm run build

real    3m37.099s
user    4m20.239s
sys     0m18.981s

With v1.3.0 is was:

npm i -D vite-plugin-eslint@~1.3 && npm ci && time npm run build

real    1m31.711s
user    1m58.827s
sys     0m9.895s
Full package.json ``` { "private": true, "name": "dummy", "version": "1.0.0", "scripts": { "vite": "vite", "build": "vite build", "dev": "vite build --mode=development", "watch": "vite build --mode=development --watch", }, "dependencies": { "date-fns": "^2.25.0", "lodash": "^4.17.21", "roboto-fontface": "*", "tiny-cookie": "^2.3.2", "v-mask": "^2.3.0", "vee-validate": "^3.4.13", "vue": "^2.6.14", "vue-i18n": "^8.27.0", "vue-i18n-composable": "^0.2.2", "vue-router": "^3.5.2", "vuetify": "^2.6.2" }, "devDependencies": { "@mdi/font": "^6.6.96", "@typescript-eslint/eslint-plugin": "^5.21.0", "@typescript-eslint/parser": "^5.21.0", "@vue/compiler-sfc": "^3.2.33", "@vue/composition-api": "^1.6.0", "@vue/eslint-config-typescript": "^10.0.0", "axios": "^0.27.2", "eslint": "^8.14.0", "eslint-plugin-putout": "^15.1.1", "eslint-plugin-vue": "^8.7.1", "esno": "^0.14.1", "kolorist": "^1.5.1", "putout": "^25.15.1", "rollup-plugin-gzip": "^3.0.1", "sass": "~1.32", "typescript": "^4.6.3", "unplugin-vue-components": "^0.19.3", "unplugin-vue2-script-setup": "^0.10.2", "vite": "^2.9.6", "vite-plugin-eslint": "~1.3", "vite-plugin-pwa": "^0.12.0", "vite-plugin-vue2": "^2.0.0", "vue-eslint-parser": "^8.3.0" } } ```
gxmari007 commented 2 years ago

Your eslint config? Cache was false by default.

iamrgroot commented 2 years ago

Your eslint config? Cache was false by default.

Full .eslintrc.js ```js const spaces = 4; const eslint_rules = { 'array-bracket-newline': ['error', 'consistent'], 'arrow-spacing': ['error', { before: true, after: true, }], 'block-spacing': ['error', 'always'], 'brace-style': ['error', '1tbs'], 'comma-dangle': ['error', 'always-multiline'], 'comma-spacing': ['error'], 'comma-style': ['error'], 'dot-location': ['error', 'property'], 'dot-notation': ['error'], 'eqeqeq': ['error'], 'func-call-spacing': ['error'], 'key-spacing': ['error'], 'keyword-spacing': ['error'], 'no-constant-condition': ['error'], 'no-empty-pattern': ['error'], 'no-extra-parens': ['error'], 'no-irregular-whitespace': ['error'], 'no-sparse-arrays': ['error'], 'no-useless-concat': ['error'], 'object-curly-spacing': ['error', 'always'], 'object-property-newline': ['error', { allowAllPropertiesOnSameLine: false }], 'object-curly-newline': ['error', { 'ObjectExpression': { multiline: true, minProperties: 3, }, 'ObjectPattern': { multiline: true, minProperties: 3, }, 'ImportDeclaration': { multiline: true, minProperties: 5, }, 'ExportDeclaration': { multiline: true, minProperties: 3, }, }], 'prefer-template': ['error'], 'space-in-parens': ['error'], 'space-infix-ops': ['error'], 'space-unary-ops': ['error'], 'template-curly-spacing': ['error'], }; const vue_rules = {}; for (const rule in eslint_rules) { vue_rules[`vue/${rule}`] = eslint_rules[rule]; } module.exports = { root: true, env: { es2021: true, }, ignorePatterns: ['.eslintrc.js', 'resources/ts/plugins/daypilot/daypilot-vue.js'], extends: [ 'plugin:vue/recommended', 'eslint:recommended', '@vue/typescript/recommended', ], parser: 'vue-eslint-parser', parserOptions: { parser: '@typescript-eslint/parser', ecmaVersion: 2021, project: './tsconfig.json', }, plugins: [ 'putout', ], rules: { 'semi': ['error', 'always'], 'no-trailing-spaces': ['error'], 'no-console': process.env.NODE_ENV === 'production' ? 2 : 1, 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1, 'quotes': ['error', 'single'], 'no-else-return': ['error'], 'no-eval': ['error'], 'no-var': ['error'], 'no-alert': ['error'], 'function-paren-newline': ['error', 'multiline-arguments'], ...eslint_rules, ...vue_rules, 'vue/no-export-in-script-setup': ['error'], 'vue/valid-define-props': ['error'], 'vue/valid-define-emits': ['error'], 'vue/valid-v-slot': ['error', { allowModifiers: true }], 'vue/component-tags-order': ['error', { 'order': [ 'template', 'style', 'script' ] }], 'vue/prop-name-casing': ['error', 'snake_case'], 'vue/no-deprecated-scope-attribute': ['error'], 'vue/component-definition-name-casing': ['off'], 'vue/html-indent': ['error', spaces], 'vue/block-tag-newline': ['error'], 'vue/custom-event-name-casing': ['error', 'kebab-case'], 'vue/no-deprecated-v-is': ['error'], 'vue/no-duplicate-attr-inheritance': ['error'], 'vue/no-empty-component-block': ['error'], 'vue/no-multiple-objects-in-class': ['error'], 'vue/no-reserved-component-names': ['error', { disallowVue3BuiltInComponents: true }], 'vue/no-unused-properties': ['error'], 'vue/no-unused-refs': ['error'], 'vue/no-useless-mustaches': ['error'], 'vue/no-useless-v-bind': ['error'], 'vue/padding-line-between-blocks': ['error', 'always'], 'vue/require-emit-validator': ['error'], 'vue/script-indent': ['error', spaces, { switchCase: 1 }], 'vue/v-on-event-hyphenation': ['error', 'always', { autofix: true }], 'vue/valid-next-tick': ['error' ], 'vue/no-unregistered-components': ['error', { ignorePatterns: ['v-', 'router-view'] }], 'vue/multi-word-component-names': ['off'], '@typescript-eslint/camelcase': ['off'], '@typescript-eslint/no-explicit-any': ['off'], '@typescript-eslint/ban-ts-ignore': ['off'], '@typescript-eslint/explicit-module-boundary-types': ['off'], '@typescript-eslint/ban-ts-comment': ['off'], '@typescript-eslint/no-unused-vars': ['error'], 'putout/single-property-destructuring': 'error', 'putout/multiple-properties-destructuring': 'error', 'putout/long-properties-destructuring': 'error', 'putout/destructuring-as-function-argument': 'error', // TODO fix for windows 'putout/newline-function-call-arguments': 'error', 'putout/function-declaration-paren-newline': 'error', 'putout/remove-newline-after-default-import': 'error', 'putout/objects-braces-inside-array': 'off', }, }; ```
gxmari007 commented 2 years ago

Do you turn on ESLint caching?

iamrgroot commented 2 years ago

Do you turn on ESLint caching?

Thanks, this was it. I thought I already tried it, but apparently not...