1.0.17 • Published 8 months ago

eslint-config-geksones- v1.0.17

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Personal eslint config

Slightly extended airbnb base config with prettier and html parsing support. The point is to include eslint and prettier formating in project by installing the only one npm package and writing one .eslintrc file. Package already has eslint itself in dependencies.

Supported extensions: *.ts, *.js, *.html.

NOTE: to get vscode-eslint html parsing support, we need to add the folowing in vscode settings.

"eslint.validate": [
  "html" // Add "html" to enable linting `.html` files.
]

Usage

Examples of .eslintrc file below

Default

{
  "root": true,
  "extends": "eslint-config-geksones-"
}

Angular

{
  "root": true,
  "extends": "eslint-config-geksones-",
  "overrides": [
    {
      "files": [
        "*.component.ts"
      ],
      "extends": [
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/template/process-inline-templates"
      ],
      "rules": {
        "class-methods-use-this": "off"
      }
    },
    {
      "files": [
        "*.component.html"
      ],
      "extends": [
        "plugin:@angular-eslint/template/recommended"
      ]
    }
  ]
}

Usefull tips

1. default-case issue

It doesn't require you to write default case specifictly. You just can leave a comment // no default in switch block. The rule is described here.

switch (a) {
    case 1:
        /* code */
        break;

    // no default
}

2. consistent-type-imports and Angular's Dependency Injection issue

If your are using Angular and came across the issue when your injected dependencies imports are replaced with type only imports so this is your case. Just add "emitDecoratorMetadata": true, into your "compilerOptions" to fix.

1.0.17

8 months ago

1.0.16

9 months ago

1.0.15

1 year ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago