@jvdx/eslint-config

4.1.0 • Public • Published

@jvdx/eslint-config

Notice: The old configuration can be found in the v3 branch.

jvdx's ESLint configuration, with sensible defaults for ES6, React and TypeScript projects.
This configuration is specifically for the new eslint.config.js flat file configuration format.

It exports a configs objects with the following rulesets:

  • recommended - Recommended rules targeting **/*.{js,jsx,mjs,cjs} files
  • react - React rules targeting **/*.{js,jsx,ts,tsx} files
    • These rules should be used in conjunction with the base or typescript rulesets
  • typescript - TypeScript rules targeting **/*.{ts,tsx,mts,cts}

See the Configurations section for more details.

Installation

Install configuration as well as peer dependencies:

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

Usage

Use in your eslint.config.js file anytime you want to extend one of the configs:

import jvdxConfig from '@jvdx/eslint-config';

export default [
	// Apply recommended rules
	jvdxConfig.configs.recommended,

	// Apply recommended rules and overwrite some configuration properties
	{
		...jvdxConfig.configs.recommended
		files: ['**/*.js'],
	},

	// Apply recommended + react rules in conjunction
	...jvdxConfig.configs.recommended,
	...jvdxConfig.configs.react,

	// Apply typescript + react rules in conjunction
	...jvdxConfig.configs.typescript,
	...jvdxConfig.configs.react,
];

Configurations

Recommended

  • Extends eslint:recommended and eslint-config-prettier
  • Targets **/*.{js,jsx,mjs,cjs} files
  • Uses the default parser
  • Uses no plugins

React

  • Extends eslint-plugin-react:recommended, eslint-plugin-react:jsx-runtime eslint-plugin-react-hooks:recommended and eslint-plugin-jsx-a11y:recommended
  • Targets **/*.{js,jsx,ts,tsx} files
  • Uses the default parser
  • Uses react, react-hooks and jsx-a11y plugins

TypeScript

  • Extends @typescript-eslint/recommended, eslint:recommended and eslint-config-prettier
  • Targets **/*.{ts,tsx,mts,cts} files
  • Uses the @typescript-eslint/parser parser
  • Uses @typescript-eslint/eslint-plugin plugin

Package Sidebar

Install

npm i @jvdx/eslint-config

Weekly Downloads

46

Version

4.1.0

License

MIT

Unpacked Size

8.87 kB

Total Files

7

Last publish

Collaborators

  • joelvoss