Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

@rasmuslp/eslint-config

NPM package Github: CI CD

This configuration is based on eslint-config-airbnb-typescript, but with a few tweaks and most notibly:

  • indentation: tab

Configurations

This project provides both a JavaScript and a TypeScript configuration file. Defaults to TypeScript.

Installation

Install the config:

$ npm install --save-dev @rasmuslp/eslint-config

NB: For npm 6 the peer dependencies also needs to be installed manually.

See peer dependencies:

$ npm info "@rasmuslp/eslint-config@latest" peerDependencies

Automatically install peer dependencies:

$ npx install-peerdeps --dev @rasmuslp/eslint-config

Or manually install peer dependencies:

$ npm install --save-dev \
		@typescript-eslint/eslint-plugin@5 \
		eslint@8 \
		eslint-plugin-deprecation@1 \
		eslint-plugin-import@2 \
		eslint-plugin-node@11 \
		eslint-plugin-promise@6 \
		eslint-plugin-unicorn@40 \
		typescript@4

Usage

Configure eslint in your project by extending this configuration in your local .eslintrc.json

{
	"root": true,
	"parserOptions": {
		"project": "./tsconfig.eslint.json"
	},
	"extends": [
		"@rasmuslp"
	]
}

The TypeScript config is utilized by certain rules that require type information.

To lint all project files, besides what the default tsconfig does, add tsconfig.eslint.json with:

{
	"extends": "./tsconfig.json",
	"include": ["./"]
}

Lastly, specify the minimum supported Node version in package.json to enable checks for using unsupported Node features.

	"engines": {
		"node": ">=12.22.0"
	}

TypeScript and React

Install additional dependencies

$ npm install --save-dev eslint-config-airbnb

Configure eslint in your project by extending this configuration in your local .eslintrc.json

{
	"root": true,
	"extends": [
		// Load broader rules first
		"airbnb",
		"airbnb-typescript",
		// Then override with more specific rule set
		"@rasmuslp/eslint-config/src/typescript-react"
	]
}

JavaScript

You can omit installing @typescript-eslint/eslint-plugin and typescript, but you will get warnings about missing peer dependencies.

Configure eslint in your project by extending this configuration in your local .eslintrc.json

{
	"root": true,
	"extends": "@rasmuslp/eslint-config/src/javascript"
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published