1.7.1 • Published 1 year ago

@knodes/eslint-config v1.7.1

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

@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

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',
	},
};
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
1.7.1

1 year ago

1.7.0

1 year ago

1.6.5

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago