Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@knodes/eslint-config

KnodesCommunity190MIT1.7.1

ESLint rules & presets for Knodes

eslint

readme

@knodes/eslint-config

ESLint rules & presets for Knodes

This set of rules is released open-source for anyone to use. It is meant to be a strict, aerated configuration.

Main features

:white_check_mark: is always installed, :white_medium_square: is optional.

Configurations quick outline:

  • Angular:
    • @knodes/eslint-config/angular
    • @knodes/eslint-config/angular/jest
    • For libs:
      • @knodes/eslint-config/angular/lib
      • @knodes/eslint-config/angular/lib/jest
  • Nest: @knodes/eslint-config/nest
  • Bare:
    • Pure JS: @knodes/eslint-config/js
    • JS + TS: @knodes/eslint-config/ts
    • JS + TS + rxjs: @knodes/eslint-config/ts-rxjs

You can also use configuration fragments from @knodes/eslint-config/config-fragments/*. See the directory on GitHub.

Installation & configuration

For any preset, you must at least install base dependencies.

npm install --save-dev @knodes/eslint-config eslint eslint-plugin-import eslint-plugin-jsdoc eslint-plugin-prefer-arrow eslint-plugin-sort-export-all eslint-plugin-eslint-comments

If you're using Typescript, install also @typescript-eslint related dependencies.

npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser

Angular

npm install --save-dev @knodes/eslint-config eslint \
  eslint-plugin-import eslint-plugin-jsdoc eslint-plugin-prefer-arrow eslint-plugin-sort-export-all eslint-plugin-eslint-comments \
  @typescript-eslint/eslint-plugin @typescript-eslint/parser \
  @angular-eslint/eslint-plugin @angular-eslint/eslint-plugin-template @angular-eslint/template-parser

Without/other framework

<summary>See sample .eslintrc.js for Typescript</summary>
module.exports = {
    env: { /* See https://eslint.org/docs/user-guide/configuring#specifying-environments. es2020 is enabled by default */ },
    extends: '@knodes/eslint-config/ts',
    parserOptions: {
        project: './tsconfig.json',
    },
};
<summary>See sample .eslintrc.js for Javascript</summary>
module.exports = {
    env: { /* See https://eslint.org/docs/user-guide/configuring#specifying-environments. es2020 is enabled by default */ },
    extends: '@knodes/eslint-config/js',
};
Assumed directory structure
  • *.{j,t}s: Project configuration files. Light lint rules are applied. It includes .eslintrc.js.
  • **
    • index.[jt]s{x,}: Barrel files, only exporting other source files
    • *.[jt]s{x,}: Source files
    • *.{spec,test}.[jt]s{x,}: Unit test files. Configured for jest by default, unless framework use a different test runner
    • __mocks__/**/*.[jt]s{x,}: Module mocks for unit tests
    • test-utils/**/*.[jt]s{x,}: Various testing utilities

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.7.1 (2023-04-09)

1.7.0 (2023-03-03)

1.6.5 (2022-04-30)

1.6.4 (2022-04-01)

1.6.3 (2022-02-16)

1.6.2 (2022-02-14)

Bug Fixes

  • ts: disable no-underscore-dangle since _ is a required prefix for private members (b4ed1ce)

1.6.1 (2022-02-04)

Bug Fixes

  • replace scitizen with knodes in descriptions, imports, tests, & add in import rules (ff08200)

1.6.0 (2022-02-04)

Features

  • plugin/typescript-eslint: require leading underscore for private methods/properties (afe1de2)
  • plugins/jsdoc: add custom tags category, typeparam (TS) & usage (JS | TS) (b69df19)

1.5.1 (2021-09-10)

Bug Fixes

  • plugin/import: match # & ~ without suffix/path (53c4171)

1.5.0 (2021-09-02)

Features

  • plugin/import: add #** imports before ~** and after @scitizen imports (4bf29de)

Bug Fixes

  • config/ts: add tests directory as using ts-test fragment (0856746)
  • plugin/import: disable import/named because of bug import-js/eslint-plugin-import#2187 (40f2faa)

1.4.7 (2021-08-21)

1.4.6 (2021-08-21)

1.4.5 (2021-08-17)

1.4.4 (2021-07-30)

Bug Fixes

  • angular: use multiple paths for unit tests (ac16e87)
  • js: allow dev dependencies in configs (10d2b74)
  • jsdoc: properly support overloads, disable rule for tests (a4308b9)
  • typescript: ignore unused rest in destructuring (80673b1)

1.4.3 (2021-06-14)

Bug Fixes

  • jsdoc: disable check of getter/setter/ctor, disable param type for TS (62b1c6d)

1.4.2 (2021-06-14)

Bug Fixes

  • jsdoc: restore require of jsdoc on methods (12af90c)

1.4.1 (2021-06-08)

Bug Fixes

  • fix export of fragments, update dependencies (a822a96)

1.4.0 (2021-05-16)

Features

  • nest: better rules for test dir (f50393c)
  • ts: light rules on custom typings dir (types) (8a81bfe)

Bug Fixes

  • change packages versions to avoid benmosher/eslint-plugin-import#2067 (bc7be2e)

1.3.1 (2021-05-10)

1.3.0 (2021-05-09)

Features

  • angular: add libs configs (6969ae7)
  • angular: customize default rules (63e544a)
  • comments: add eslint-plugin-comments (56f8a3f)
  • eslint: allow time and timeEnd on console (bdf0034)
  • add testing overrides (b27d97d)

Bug Fixes

  • map exports fragments (8bbc877)
  • angular: fix naming of configs (a0d0ff6)

1.2.0 (2021-05-01)

Features

  • angular: apply light js lint rules on test index (a391628)
  • angular: update to latest plugins, use more strict rules (7f3a7ba)
  • js: apply sort export rules on every js & ts files, not only under src (3421bb8)

1.1.1 (2021-01-08)

1.1.0 (2021-01-08)

Features

  • add rule to sort exports of barrel files (index.{j,t}s{,x}) (a112e23)

1.0.4 (2021-01-07)

Bug Fixes

  • ts: apply test config on test-utils & mocks dir & light js config on root files (06ea968)

1.0.3 (2021-01-07)

Bug Fixes

  • angular: use js-config fragment for ./.js & ./e2e/.js (5016bad)

1.0.2 (2021-01-06)

1.0.1 (2021-01-05)

Bug Fixes

  • angular: add missing angular-eslint plugin, root js env is node (af4393b)
  • angular: complete tests rules (b04f561)
  • nest: include e2e tests in tests config, fix test preset name (bb3e431)

1.0.0 (2021-01-05)

Features