Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop ESLINT_NO_IMPORTS #122

Merged
merged 2 commits into from
Oct 7, 2023
Merged

Drop ESLINT_NO_IMPORTS #122

merged 2 commits into from
Oct 7, 2023

Conversation

fregante
Copy link
Contributor

@fregante fregante commented Oct 7, 2023

eslint-plugin-import is super slow and we added the ESLINT_NO_IMPORTS env to skip those rules, but it's been broken. The code just dropped the local rule config but did nothing against the rules in eslint-config-xo-typescript, so it had the opposite effect.

I tried configuring it properly by setting an override for every file, disabling every rule, 195fb67 but the linting still takes 5m16s.

Example usage:

ESLINT_NO_IMPORTS=1 npx eslint src --ext js,jsx,ts,tsx --quiet

@fregante fregante marked this pull request as ready for review October 7, 2023 16:22
@fregante
Copy link
Contributor Author

fregante commented Oct 7, 2023

This works if it appears in the final config, i.e. .eslintrc.js in the extension itself:

if (process.env.ESLINT_NO_IMPORTS) {
	const importRules = Object.keys(require('eslint-plugin-import').rules);
	for (const ruleName of importRules) {
		module.exports.rules[`import/${ruleName}`] = "off";
	}
}

@fregante fregante merged commit 6315869 into main Oct 7, 2023
2 checks passed
@fregante fregante deleted the fix-no-imports branch October 7, 2023 16:25
@fregante
Copy link
Contributor Author

fregante commented Oct 7, 2023

ESLINT_NO_IMPORTS=1 nr lint shows hundreds of errors so I assume nobody has been using it for ages, so I merged this. It can be fixed and added again if anyone cares

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant