Skip to content

infinum/js-linters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@infinum/eslint-plugin

This package provides Infinum's ESLint plugin.

Installation

npm install --save-dev @infinum/eslint-plugin

Usage

The basic usage of this plugin is to extend the plugin:@infinum/core config in your ESLint configuration file.

{
	"extends": ["plugin:@infinum/core"]
}

However, we can also extend .eslintrc with additional configs. The idea is to have modular configs and that you can choose what rules you want to have on the project. E.g., there is no need to have TypeScript rules on a JavaScript project. The entire list of configs can be found in src/configs/index.ts.

NOTE: some configs require additional plugins to be installed. E.g., @infinum/react requires eslint-plugin-react and eslint-plugin-react-hooks to be installed.

Angular Preset

Install the following packages:

npm install --save-dev eslint-plugin-rxjs eslint-plugin-jasmine @infinum/eslint-plugin

Add this to you eslint config:

{
	"extends": ["plugin:@infinum/core", "plugin:@infinum/typescript", "plugin:@infinum/angular"],
	"parserOptions": {
		"project": ["./tsconfig.json"]
	}
}

Infinum React Stack Preset

Install the following packages:

npm install -D -E \
@infinum/eslint-plugin@2 \
eslint-plugin-react@7 \
eslint-plugin-react-hooks@4 \
eslint-plugin-jsx-a11y@6 \
@typescript-eslint/eslint-plugin@7 \
@typescript-eslint/parser@7 \
@next/eslint-plugin-next@14 \
eslint-plugin-typescript-enum@2 \
eslint-plugin-chakra-ui@0.11

Add this to you eslint config:

{
	"extends": [
		"plugin:@infinum/core",
		"plugin:@infinum/typescript",
		"plugin:@infinum/react",
		"plugin:@infinum/next-js",
		"plugin:@infinum/chakra-ui"
	],
	"parserOptions": {
		"project": ["./tsconfig.json"]
	}
}

License

The MIT License

Credits

js-linters is maintained and sponsored by Infinum.