/config DEPRECATED! Visit https://github.com/azimutlabs/eslint instead.
Our sharable configurations and code standards
ESLint configurations used in our projects
We assume that you already have eslint
package installed.
$ npm i -D @azimutlabs/eslint-config
legacy
- default lint rules with some plugin extensions.- required libs:
babel-eslint eslint-plugin-import
,eslint-plugin-array-func
,eslint-plugin-functional
,eslint-plugin-simple-import-sort
- required libs for typescript:
@typescript-eslint/parser
,@typescript-eslint/eslint-plugin
- download command:
npm i -D babel-eslint eslint-plugin-import eslint-plugin-array-func eslint-plugin-functional eslint-plugin-simple-import-sort @typescript-eslint/parser @typescript-eslint/eslint-plugin
- required libs:
prettier
- prettier config for eslint.- required libs:
prettier
,eslint-config-prettier
,eslint-plugin-prettier
- download command:
npm i -D prettier eslint-config-prettier eslint-plugin-prettier
- required libs:
jest
- jest specific rules.- required libs:
eslint-plugin-jest
- download command:
npm i -D eslint-plugin-jest
- required libs:
react
- react specific rules with extensions.- required libs:
eslint-plugin-react
,eslint-plugin-react-hooks
- download command:
npm i -D eslint-plugin-react eslint-plugin-react-hooks
- required libs:
a11y
- jsx accessibility.- required libs:
eslint-plugin-jsx-a11y
- download command:
npm i -D eslint-plugin-jsx-a11y
- required libs:
Extending ALL configs via package.json
:
{
"eslintConfig": {
"extends": [
"@azimutlabs"
]
}
}
Extending configs separately:
{
"eslintConfig": {
"extends": [
"@azimutlabs/eslint-config/legacy",
"@azimutlabs/eslint-config/prettier",
"@azimutlabs/eslint-config/react"
]
}
}
Next.js config extensions
We assume that you already have next
package installed.
$ npm i -D @azimutlabs/next-config
-
withEslint
- addseslint-loader
.- usage:
// next.config.js module.exports = withEslint({ disableLintForProd: true, // disables linting process for production build phase eslintOptions: {}, // options for eslint-loader });
- required libs:
eslint
,eslint-loader
,eslint-friendly-formatter
. - download command:
npm i -D eslint-loader eslint-friendly-formatter
- usage:
-
withLodash
- optimizeslodash
dist size usinglodash-webpack-plugin
.- usage:
// next.config.js module.exports = withLodash({ lodashWebpackPluginOptions: {}, // lodash-webpack-plugin options. });
- required libs:
lodash-webpack-plugin
. - download command:
npm i -D lodash-webpack-plugin
- usage:
Combine by compose
functions:
module.exports = compose(
withEslint,
withLodash,
)({
poweredByHeader: false, // pass here all your next config options
eslintOptions: {}, // as well as extensions specific options
});