5.0.3 • Published 8 months ago

@alanscodelog/eslint-config v5.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Build Release NPM Version (with latest tag) NPM Version (with beta tag)

My preferred base eslint configs along with an "install" script for quickly setting up the configs to extend from this one.

Install

npm add -D @alanscodelog/eslint-config eslint

Run the install script (this will overwrite eslint.config.js).

./node_modules/@alanscodelog/eslint-config/install.sh

Manual Config Setup

Simple:

// eslint.config.js
import config from "@alanscodelog/eslint-config"
export default config

Advanced:

import { allFileTypes, tsEslintConfig, vueConfig } from "@alanscodelog/eslint-config"
export default tsEslintConfig( // this is just a re-export of tsEslint.config
	// https://github.com/AlansCodeLog/eslint-config
	...vueConfig,
	{
		files: [`**/*.{${allFileTypes.join(",")}}`],
		ignores: [
			// ...	
		],
	},
	// RULE LINKS
	// Eslint: https://eslint.org/docs/rules/
	// Typescript: https://typescript-eslint.io/rules/
	// Vue: https://eslint.vuejs.org/rules/
)

package.json

Add linting script to package.json:

{
	"scripts": {
		// bin only if it has scripts, not for "dist" folder of cli
		// double quotes escaped to avoid shell expanding globs which causes problems
		// *.{cjs,js,ts} so configs at root will be linted
		"lint:eslint": "eslint \"{src,tests,bin}/**/*.{cjs,js,ts}\" \"*.{cjs,js,ts}\" --max-warnings=0 --report-unused-disable-directives",
	}
}

Configs

There's 4 configs: base, js, typescript, vue.

Each sets it's rules with the file types they can apply to. So the base example applies to all, and it gets more selective as we go all the way up to vue.

Other

All rules are set to warn since I don't like the editor bleeding red. I pass --max-warnings=0 to eslint when needed instead. Personally, a rule is either useful (in general, I might still ignore them) and code should pass all lints, or it's not and the rule should be disabled.

5.0.3

8 months ago

5.0.2

8 months ago

5.0.1

8 months ago

5.0.0

8 months ago

5.0.0-beta.6

8 months ago

5.0.0-beta.7

8 months ago

5.0.0-beta.5

8 months ago

5.0.0-beta.4

1 year ago

5.0.0-beta.2

1 year ago

5.0.0-beta.3

1 year ago

5.0.0-beta.1

1 year ago

4.2.0

2 years ago

4.0.4

2 years ago

4.1.0

2 years ago

4.0.3

2 years ago

4.1.1

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.2

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.4.0-beta.6

4 years ago

1.4.0-beta.5

5 years ago

1.4.0-beta.4

5 years ago

1.4.0-beta.3

5 years ago

1.4.0-beta.2

5 years ago

1.4.0-beta.1

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.2.2

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago