2.1.0 • Published 8 months ago

@regionhalland/eslint-config v2.1.0

Weekly downloads
-
License
CC-BY-NC-SA-4.0
Repository
-
Last release
8 months ago

@regionhalland/eslint-config

To use this package, the following packages must be installed in the consuming project.

PackageVersion
ESLint^9.15.0
TypeScript^4.9.5 or ^5
Prettier^3.1.1

Recommended installation:

yarn add -D eslint typescript prettier @regionhalland/eslint-config

Exporting configs:

NameDescription
standardStandard config for React project
recommendedContains standard config with addition of the plugin simple-import-sort
strictContains recommended config with additional strict rules
nodeConfig for Node.js project (using TypeScript)
commonJsConfig for CommonJs project
configsExports only individual config objects without addition of recommended configs (ESLint, @typescript-eslint)
utilsUtility for ESLint rules merging

Sample configurations:

package.json:

// package.json
{
	...
	"script": {
		"lint": "eslint ./src",
		"lint:fix": "eslint ./src --fix"
	}
	...
}

React application:

// eslint.config.js (ESLint flat config)
import rhEslint from '@regionhalland/eslint-config';

/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
	...rhEslint.recommended,

	// Custom config
	{
		name: 'react-application',
		files: ['**/*.ts', '**/*.tsx'],
		rules: {
			'no-restricted-imports': [
				'error',
				{
					patterns: ['@/features/*/*'],
				},
			],
		},
	},
];

Node.js application:

// eslint.config.js (ESLint flat config)
const rhEslint = require('@regionhalland/eslint-config');

/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
module.exports = [
	...rhEslint.node,

	// Custom config
	{
		name: 'nodejs-application',
		files: ['**/*.js'],
		rules: {
			'no-undef': 'off',
		},
	},
];

Tools:

2.0.0-beta.2

10 months ago

2.0.0-beta.1

10 months ago

2.1.0

8 months ago

2.0.0-beta.4

9 months ago

2.0.0

9 months ago

2.0.0-beta.3

9 months ago

2.1.0-beta.1

9 months ago

2.1.0-beta.2

8 months ago

1.9.1

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago