0.2.1 • Published 3 years ago

@feltcoop/eslint-config v0.2.1

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 years ago

@feltcoop/eslint-config

an ESLint config for TypeScript, Svelte, and Prettier

npm i -D @feltcoop/eslint-config

This ESLint config is designed to complement TypeScript and Prettier, so all redundant rules are disabled. It extends no other configs, so wysiwyg👀

To distinguish linting problems from type errors while editing, all of the rules are set to warn, not error, and users are expected run eslint --max-warnings 0 to treat them as errors when desired. There may be a better way to do this, but it works well to get yellow squigglies in text editors for linting problems while reserving red for type errors.

Got questions or proposed changes? Open issues!

setup

Install ESLint dev dependencies with TypeScript and Svelte plugins:

npm i -D eslint \
	@typescript-eslint/eslint-plugin @typescript-eslint/parser \
	eslint-plugin-svelte3 \
	@feltcoop/eslint-config

Then add the following to your project's package.json or an ESLint config file:

{
	// ...package.json stuff
	"eslintConfig": {
		"root": true,
		"extends": "@feltcoop"
	}
}

vscode setup

To make the VSCode ESLint plugin work with Svelte, add the following to VSCode's settings.json:

{
	// ctrl+shift+P then `> Preferences: Open Settings (JSON)`
	// ...other config
	"eslint.validate": ["svelte", "javascript", "javascriptreact"]
}

See also the eslint-plugin-svelte3 integration docs.

overrides

Every ESLint config has opinions. This project is somewhat strict, because it's easier to disable rules than it is to enable ones that are invisibly disabled, but we don't want it to be too opinionated. We're happy to discuss proposed changes in the issues, and to override any defaults, use the rules property in your config:

{
	"eslintConfig": {
		"root": true,
		"extends": "@feltcoop",
		"rules": {
			"no-param-reassign": 0, // disable an enabled rule
			"no-console": 1, // enable a disabled rule
		}
	}
}

develop

See index.cjs and the ESLint docs.

Rules are current through eslint@8.20.0 and @typescript-eslint/eslint-plugin@5.30.7.

publish

First update the changelog with a helpful summary of changes, then:

npm version patch|minor|major|etc
npm publish --access=public
git push
git push --tags

See the official docs for npm version and npm publish.

credits 🐢🐢🐢

ESLint@typescript-eslint/eslint-plugineslint-plugin-svelte3Prettier & more

license 🐦

public domain ⚘ The Unlicense

0.2.1

3 years ago

0.2.0

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago