eslint-config-altnext
A highly opinionated configuration for ESLint and Prettier, following Altnext's styleguide.
Installation
Run npm i -D eslint-config-altnext
(or yarn add -D eslint-config-altnext
) to add this package to your project's devDependencies
.
We bundle everything necessary to run eslint
,
including eslint
itself.
Usage
In your .eslintrc.js
(or any other file you use to configure eslint),
add the config you want from this package to the extends
field.
For example:
module.exports = {
extends: ['altnext'],
};
We provide 2 configs, altnext
(or altnext/type-checking
, which point to the same config),
and altnext/base
, which includes the base config, excluding rules that require type information to run.
If you use altnext
(or altnext/type-checking
),
you'll need to add a reference to your project's tsconfig.json
,
for example:
module.exports = {
extends: ['altnext'],
parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'] },
};
Prettier
We also bundle Altnext's prettier
configuration in this package.
To use it, simply set your project's .prettierrc.js
file to the following:
module.exports = require('eslint-config-altnext/.prettierrc');
Plugins
We use a wide variety of plugins and other packages, all of whom are bundled as dependencies of this package.
Special thanks to the maintainers and contributors of these packages.
The following are the various packages and plugins included when adding this package:
@typescript-eslint/{eslint-plugin,parser}
eslint
eslint-config-prettier
eslint-import-resolver-alias
eslint-import-resolver-typescript
eslint-plugin-import
eslint-plugin-jest
eslint-plugin-jest-formatting
eslint-plugin-jsx-a11y
eslint-plugin-node
eslint-plugin-playwright
eslint-plugin-prettier
eslint-plugin-react
eslint-plugin-react-hooks
eslint-plugin-unicorn
prettier