1.22.0 • Published 10 months ago

@nvon/eslint-config v1.22.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
10 months ago

NVON coding styles

Consistent prettier/linting/typescript configs with strict defaults.

About the name

The name is pretty misleading, as this does not only contain an eslint-config, but also prettier and typescript configs. This is due to a eslint restriction, which does not allow for more customized names in scoped packages.

Usage

Basically, extend one of the given configs, overwriting the props you want changed.

eslint

The following base configs are available:

  • @nvon/eslint-config/eslint-configs/base.cjs
  • @nvon/eslint-config/eslint-configs/react.cjs
  • @nvon/eslint-config/eslint-configs/gatsby.cjs
  • @nvon/eslint-config/eslint-configs/nextjs.cjs

On top of them, you can apply additional rulesets that match your workflow.

🚨 Be sure to always extend the base config last!

  • @nvon/eslint-config/eslint-configs/jsdoc.cjs

Stricter rules for comments via plugin:jsdoc. Recommended for package authors.

  • @nvon/eslint-config/eslint-configs/i18n.cjs

Strict rules when using i18n.

Using eslint configs in your .eslintrc.js

Note: Since this package is an ESM package, all configs are available as .cjs files. You need to specify the extension when extending!

module.exports = {
  extends: [
    "@nvon/eslint-config/eslint-configs/jsdoc.cjs",
    "@nvon/eslint-config/eslint-configs/react.cjs", // base config goes last
  ],
};

Prettier

Currently, there is only a single prettier config:

  • @nvon/eslint-config/prettier-configs/base

Using it in your .prettierrc.js

module.exports = {
  ...require("@nvon/eslint-config/prettier-configs/base.cjs"),
};

TypeScript config

Currently, there is are the following tsconfig files:

  • @nvon/eslint-config/ts-configs/base
  • @nvon/eslint-config/ts-configs/compile-package-esm
  • @nvon/eslint-config/ts-configs/compile-package-cjs

Use it in your tsconfig.json

{
  "extends": "@nvon/eslint-config/ts-configs/base.json"
}

Development

To work on the publishing scripts, npm run scripts-compile-watch can be used. Compiled scripts are accessible in scripts/dist.

For passing flags to scripts, you need to use a -- between the script and your flags. Otherwise, those flags will be consumed before the script is invoked:

npm run publish-package -- --minor --dry-run

Debugging scripts

For debugging an npm script in vscode, the launch.json can be adjusted, so that the runtimeArgs reflect the script you want to debug.

Publishing

  • make sure your git repository is clean
  • decide on the version change (patch/minor/major)
  • run the publish-package command: npm run publish-package -- --minor
1.22.0

10 months ago

1.21.1

1 year ago

1.21.0

2 years ago

1.19.0

2 years ago

1.19.1

2 years ago

1.20.1

2 years ago

1.20.2

2 years ago

1.20.0

2 years ago

1.20.3

2 years ago

1.18.1

2 years ago

1.18.0

2 years ago

1.17.0

2 years ago

1.16.0

2 years ago

1.15.0

2 years ago

1.14.0

2 years ago

1.15.3

2 years ago

1.15.2

2 years ago

1.15.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.13.1

2 years ago

1.1.0

2 years ago

1.13.0

2 years ago

1.10.3

2 years ago

1.12.0

2 years ago

1.10.2

2 years ago

1.9.1

2 years ago

1.8.2

2 years ago

1.9.0

2 years ago

1.8.1

2 years ago

1.8.0

2 years ago

1.5.3

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.5.2

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.1.3

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.8.7

2 years ago

1.8.6

2 years ago

1.8.5

2 years ago

1.8.4

2 years ago

1.8.3

2 years ago

1.11.0

2 years ago

1.10.1

2 years ago

1.10.0

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago