npm.io
22.1.0 • Published 2 weeks ago

eslint-config-nlueg-angular

Licence
MIT
Version
22.1.0
Deps
10
Size
8 kB
Vulns
0
Weekly
0
Stars
1

eslint-config-nlueg-angular

GitHub License NPM version

This package includes a basic ESLint configuration for linting and formatting my Angular code.

As a basis I use Angular ESLint, TypeScript ESLint, eslint-config-prettier and eslint-plugin-rxjs. Also I include eslint-plugin-import-x and eslint-plugin-unused-imports to have beautiful imports.

I use this config basically in every Angular-Project to have less smelly and well formatted code

Installation

Install the plugin with npm

  npm install eslint-config-nlueg-angular

Create eslint.config.mjs at your root folder and extend from the config:

import baseConfig from './node_modules/eslint-config-nlueg-angular/eslint.config.mjs';

export default [
...baseConfig,
];

You can also change some specific rules like the following:

import baseConfig from './node_modules/eslint-config-nlueg-angular/eslint.config.mjs';
import angularEslintTemplate from '@angular-eslint/eslint-plugin-template';

export default [
  ...baseConfig,
  {
    plugins: {
      "@angular-eslint/template": angularEslintTemplate,
    },
    rules: {
      "@typescript-eslint/no-empty-function": "off",
      "@typescript-eslint/no-explicit-any": "off",
      "@typescript-eslint/no-non-null-assertion": "off",
      "@angular-eslint/template/click-events-have-key-events": "warn",
      "@angular-eslint/template/interactive-supports-focus": "warn",
    }
  }
];

Ensure that you define the corresponding plugin where the specific rule is defined in. Otherwise, it won't work to change the severity of a rule.

Keywords