eslint-config-digtrax
is a shared ESLint configuration that includes rules and settings for JavaScript/TypeScript projects. This configuration helps maintain consistent code quality across multiple projects.
To use this configuration in your project, you can install it using either npm or Yarn.
-
Install
eslint-config-digtrax
:npm install eslint-config-digtrax --save-dev
-
Install the necessary peer dependencies:
npm install @typescript-eslint/eslint-plugin@^2.23.0 @typescript-eslint/parser@^2.23.0 eslint@6.8.0 eslint-config-airbnb@^18.1.0 eslint-plugin-import@^2.29.1 eslint-config-prettier@^6.10.0 eslint-plugin-jsx-a11y@6.2.3 eslint-plugin-prefer-arrow@^1.2.3 eslint-plugin-prettier@^3.1.2 eslint-plugin-promise@^4.2.1 eslint-plugin-react@7.19.0 eslint-plugin-react-hooks@2.5.0 --save-dev
-
Install
eslint-config-digtrax
:yarn add eslint-config-digtrax --dev
-
Install the necessary peer dependencies:
yarn add @typescript-eslint/eslint-plugin@^2.23.0 @typescript-eslint/parser@^2.23.0 eslint@6.8.0 eslint-config-airbnb@^18.1.0 eslint-plugin-import@^2.29.1 eslint-config-prettier@^6.10.0 eslint-plugin-jsx-a11y@6.2.3 eslint-plugin-prefer-arrow@^1.2.3 eslint-plugin-prettier@^3.1.2 eslint-plugin-promise@^4.2.1 eslint-plugin-react@7.19.0 eslint-plugin-react-hooks@2.5.0 --dev
To use the eslint-config-digtrax
configuration, extend it in your ESLint configuration file (e.g., .eslintrc.json
, .eslintrc.js
, etc.).
.eslintrc.json
{
"extends": ["eslint-config-digtrax"],
"parser": "@typescript-eslint/parser"
}
.eslintrc.js
module.exports = {
extends: ['eslint-config-digtrax'],
parser: '@typescript-eslint/parser',
};
This configuration file should include "eslint-config-digtrax"
in the "extends" array and set "@typescript-eslint/parser"
as the parser. Make sure that "eslint-config-digtrax"
is placed last in the "extends" array if you are combining it with other configurations, so it can properly override conflicting rules.
You can override specific rules in your project's ESLint configuration to suit your needs.
.eslintrc.json
{
"extends": ["eslint-config-digtrax"],
"parser": "@typescript-eslint/parser",
"rules": {
"no-console": "off"
}
}
In this example, the no-console
rule is turned off, allowing the use of console.log
and other console methods.
This project is licensed under the MIT License.