18.0.0 • Published 1 year ago

@s-libs/eslint-config-ng v18.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This library provides some default config you can use for ESLint in an Angular project.

"Recommended" Config

Follow these instructions to get all the community-recommended config from ESLint, @typescript-eslint, and @angular-eslint.

  1. First install Angular ESLint, following their instructions for your situation. Make sure it is working with their default config.
  2. npm install --save-dev @s-libs/eslint-config-ng
  3. Change .eslintrc.json in your root directory to this, and make adjustments to suit your needs:

    {
      "extends": "@s-libs/eslint-config-ng",
      "overrides": [
        {
          "files": ["*.ts"],
          "rules": {
            "@angular-eslint/directive-selector": ["error", { "type": "attribute", "prefix": "app", "style": "camelCase" }],
            "@angular-eslint/component-selector": ["error", { "type": "element", "prefix": "app", "style": "kebab-case" }]
          }
        }
      ]
    }

Strict Config

Use these instructions for much stricter linting, start with the instructions above then continue with these. It starts with all rules from the libraries above, then turns off or modifies rules that Simonton Software subjectively thinks makes the config better.

  1. Follow the instructions above for recommended config and ensure it works.
  2. npm install --save-dev eslint-config-prettier
  3. Change extends in .eslintrc.json to @s-libs/eslint-config-ng/strict
  4. Add the parserOptions to the .eslintrc.json file you created, so it looks like this:

    {
      "extends": "@s-libs/eslint-config-ng/strict",
      "overrides": [
        {
          "files": ["*.ts"],
          "parserOptions": {
            "project": ["tsconfig.(app|spec).json"]
          },
          "rules": {
            "@angular-eslint/directive-selector": ["error", { "type": "attribute", "prefix": "app", "style": "camelCase" }],
            "@angular-eslint/component-selector": ["error", { "type": "element", "prefix": "app", "style": "kebab-case" }]
          }
        }
      ]
    }

Warning: the configs from underlying libraries is not as stable as the ones used for their "recommended" configs. It can change with minor version updates to the underlying libraries.

18.0.0

1 year ago

18.0.0-next.0

1 year ago

17.1.0

2 years ago

17.0.0-next.2

2 years ago

17.0.0-next.0

2 years ago

17.0.0-next.1

2 years ago

17.0.0

2 years ago

16.1.0

2 years ago

16.0.0-next.0

2 years ago

16.0.0-next.1

2 years ago

16.0.0-next.2

2 years ago

16.0.0

2 years ago

15.2.0

2 years ago

15.0.0

3 years ago

15.1.0

2 years ago

15.0.0-next.0

3 years ago

14.1.0

3 years ago

14.0.0

3 years ago

14.0.0-next.0

3 years ago

13.1.0

4 years ago

13.0.0

4 years ago

13.1.0-next.2

4 years ago

13.1.0-next.1

4 years ago

13.1.0-next.0

4 years ago

13.0.0-next.0

4 years ago

12.0.0

4 years ago

12.0.0-next.1

4 years ago

12.0.0-next.0

4 years ago