17.1.0 • Published 4 months ago

@s-libs/eslint-config-ng v17.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months 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.

17.1.0

4 months ago

17.0.0-next.2

6 months ago

17.0.0-next.0

6 months ago

17.0.0-next.1

6 months ago

17.0.0

6 months ago

16.1.0

9 months ago

16.0.0-next.0

1 year ago

16.0.0-next.1

1 year ago

16.0.0-next.2

1 year ago

16.0.0

11 months ago

15.2.0

1 year ago

15.0.0

1 year ago

15.1.0

1 year ago

15.0.0-next.0

1 year ago

14.1.0

2 years ago

14.0.0

2 years ago

14.0.0-next.0

2 years ago

13.1.0

2 years ago

13.0.0

2 years ago

13.1.0-next.2

2 years ago

13.1.0-next.1

2 years ago

13.1.0-next.0

2 years ago

13.0.0-next.0

2 years ago

12.0.0

3 years ago

12.0.0-next.1

3 years ago

12.0.0-next.0

3 years ago