-
eslint.config.js// @ts-check
import globals from "globals";
import path from 'path';
import { fileURLToPath } from 'url';
import { FlatCompat } from '@eslint/eslintrc';
import eslint from "@eslint/js";
import tseslint from 'typescript-eslint';
import vueEslintParser from "vue-eslint-parser";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const eslintrc = new FlatCompat({
baseDirectory: __dirname
})
export default tseslint.config(
{
ignores: ["node_modules", "coverage", ".nyc_output", "dist", "**/.*"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...eslintrc.plugins('vue'),
...eslintrc.extends('plugin:vue/vue3-recommended'),
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
extraFileExtensions: ['.vue'],
parser: tseslint.parser,
sourceType: "module",
},
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
},
parser: vueEslintParser,
},
files: ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts"],
rules: {
"vue/multi-word-component-names": [
"error",
{
ignores: ["Button", "Footer", "User"],
},
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
},
); package.json
tsconfig.json{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "NodeNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"moduleResolution": "NodeNext",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"strict": true,
"strictNullChecks": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts"],
"references": [{ "path": "./tsconfig.node.json" }]
} File summary, grouped by file extension
When I run eslint on my machine:
Results:
It somehow takes almost a full minute to run through... I could try to run it on a mac but surely it should not take a full minute in a virtualized environment? |
Beta Was this translation helpful? Give feedback.
Answered by
Lilja
Mar 19, 2024
Replies: 2 comments 3 replies
-
Ignoring vue decreases time severely: - ignores: ["node_modules", "coverage", ".nyc_output", "dist", "**/.*"],
+ ignores: ["node_modules", "coverage", ".nyc_output", "dist", "**/.*", "**/*.vue"], - files: ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts"],
+ files: ["src/**/*.ts", "tests/**/*.ts"],
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Hi @Lilja, since the rules are coming from |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I managed to reduce a lot of overhead with this workaround