20.3.3 • Published 8 months ago

@hug/eslint-config v20.3.3

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
8 months ago

Installation

npm install @hug/eslint-config --save-dev
yarn add eslint@8.x @hug/eslint-config --dev

Create a tsconfig.eslint.json file at the root of your project

{
    "extends": "./tsconfig.json",
    "compilerOptions": {
        "types": [
            "node",
            "jasmine"
            //
            // In case you are using WebdriverIO
            //   "@wdio/globals/types"
            //
            // In case you are using Cypress
            //   "cypress"
            //
            // Any other types that are required by your tests
            //   ...
        ]
    },
    "include": ["src/**/*.ts", "e2e/**/*.ts"]
}
npm install @hug/eslint-config@2.x --save-dev
yarn add eslint@7.x @hug/eslint-config@2.x --dev
  1. Remove tslint and codelyzer from your dependencies
  2. Remove any tslint.json configuration files
  3. Add eslint as a dev dependency
  4. Have a look at our Angular project example and modify all your tsconfig files accordingly

Requirements

As of now this configuration is intented to work with Angular projects only.

Projects running under Angular 10.x can safely ignore @angular-eslint warnings during installation.

  • an Angular >= 10.x project

Usage

  1. Create an .eslintrc.json file at the root of your project
{
    "root": true,
    "extends": [
        /**
         *  Possible values: 'recommended (strict) | moderate (less stricter)'
         */
        "@hug/eslint-config/recommended"
    ]
}
  1. Modify your existing angular.json
"architect": {
    "lint": {
        "builder": "@angular-eslint/builder:lint",
        "options": {
            "lintFilePatterns": [
                "**/*.js",
                "**/*.json",
                "**/*.ts",
                "**/*.html"
            ]
        }
    }
}
  1. Run ng lint

You can also skip steps 2 and 3 and simply run:

eslint *.{js,json,ts,html}

Rules

This configuration exports a recommended set of rules that enforces good practices.

They may or may not served you well as they are mainly designed to be used by the HUG organization's team.

The rules applies as follow:

FilesRules
*/.tses6, typescript, angular, rxjs, no-secrets
*/.jses6, no-secrets
*/.mjses6, no-secrets
*/.htmlangular-template
*/.jsonno-secrets
e2e/*/.tses6, typescript, no-secrets, cypress, chai-friendly - in case you are using Cypress

Development

See the developer docs.

Contributing

> Want to Help?

Want to file a bug, contribute some code or improve documentation? Excellent!

But please read up first on the guidelines for contributing, and learn about submission process, coding rules and more.

> Code of Conduct

Please read and follow the Code of Conduct, and help us keep this project open and inclusive.

Credits

Copyright (C) 2021 HUG - Hôpitaux Universitaires Genève

love@hug

21.0.0-beta.1

8 months ago

21.0.0-beta.0

8 months ago

21.0.0-beta.3

8 months ago

21.0.0-beta.2

8 months ago

20.3.3

8 months ago

20.3.2

9 months ago

19.0.1

10 months ago

19.0.0

11 months ago

18.0.0

11 months ago

20.0.0

10 months ago

20.2.1

10 months ago

20.2.0

10 months ago

17.0.4

11 months ago

20.1.0

10 months ago

20.3.1

9 months ago

20.3.0

9 months ago

17.0.3

1 year ago

17.0.2

1 year ago

17.0.1

1 year ago

17.0.0

1 year ago

16.0.2

1 year ago

15.0.2

2 years ago

15.0.3

2 years ago

15.0.4

2 years ago

15.0.5

2 years ago

16.0.1

2 years ago

16.0.0

2 years ago

15.0.1

2 years ago

15.0.0

2 years ago

14.0.1

2 years ago

12.0.2

2 years ago

14.0.0

2 years ago

13.0.0

2 years ago

12.0.0

2 years ago

12.0.1

2 years ago

11.0.0

2 years ago

10.0.0

3 years ago

10.0.1

3 years ago

9.0.1

3 years ago

9.0.0

3 years ago

7.0.3

3 years ago

8.0.1

3 years ago

8.0.0

3 years ago

7.0.2

3 years ago

6.1.0

3 years ago

6.1.1

3 years ago

7.0.0

3 years ago

7.0.1

3 years ago

6.0.0

3 years ago

5.1.1

3 years ago

5.0.2

3 years ago

5.1.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.1

4 years ago

2.4.4

4 years ago

4.0.0

4 years ago

3.1.5

4 years ago

3.1.4

4 years ago

2.4.3

4 years ago

3.1.3

4 years ago

2.4.2

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

2.4.1

4 years ago

3.1.0

4 years ago

2.4.0

4 years ago

3.0.1

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

3.0.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago