@mindevieras/eslint-config-mindevieras v4.0.4
eslint-config-mindevieras
Shared ESLint configuration for TypeScript projects.
Features
- Lints TypeScript based on the latest standards.
- Fixes issues and formatting errors with Prettier.
- Supports node and browser environments.
Installation
Install the package using npm:
npm install -D @mindevieras/eslint-config-mindevierasCreate a
.eslintrcfile in the root directory of your project (wherepackage.jsonresides). Add the following content to the.eslintrcfile:{ "extends": [ "@mindevieras/eslint-config-mindevieras" ], // Or: "extends": [ "@mindevieras/eslint-config-mindevieras/react" ], }Optionally, you can add scripts to your
package.jsonfile for linting and fixing:"scripts": { "lint": "eslint .", "lint:fix": "eslint . --fix" }You can now manually lint your code by running
npm run lintand fix fixable issues withnpm run lint:fix. However, it's recommended to configure your editor to handle this automatically.
Customization
If you want to override ESLint or Prettier settings, you can add the corresponding rules to your .eslintrc file. For ESLint rules, add them under the "rules" key. You can refer to the ESLint rules documentation for more details.
Example .eslintrc file:
{
"extends": ["@mindevieras/eslint-config-mindevieras"],
"rules": {
"no-console": 2,
}
}Editor Setup (VSCode)
Install the ESLint extension for Visual Studio Code.
Open the
.vscode/settings.jsonfile in your project and add the following settings:{ "editor.formatOnSave": true, "[javascript]": { "editor.formatOnSave": false, }, "editor.codeActionsOnSave": { "source.fixAll": true }, "editor.autoIndent": "full", "editor.insertSpaces": true, "editor.formatOnPaste": false, "editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.renderWhitespace": "boundary", "editor.wordWrap": "off", "editor.detectIndentation": true, "editor.rulers": [ 120 ], "files.exclude": { "**/.git": true, "**/.DS_Store": true }, }Restart Visual Studio Code for the changes to take effect.
Note: The extension Prettier - Code formatter is not required as it is already integrated with the ESLint configuration.