Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

kontextr/ktxtr-eslint-plugins

Repository files navigation

kontextR eslint plugins

Created by yours truly ❤️

This repository holds eslint plugins which were created to improve the consistency in kontextR's source code. In order to use most of them (they will be marked accordingly), you will need to run them using prettier-eslint.
The source code is published under the MIT license.

How to use it

Install the plugin like any other using npm npm install --save-dev @ktxtr/eslint-plugin-{name}. You can use it by adding plugins: [ "@ktxtr/{name}" ] to your .eslintrc file.

Available packages

  • @ktxtr/eslint-plugin-prettier - auto-fixers and formatters for our prettier2eslint bridge

Publishing plugins

  • Commit all changes, but don't modify package.json version
  • Run npm run publish and select appropriate version change
  • Lerna will increment the version, create git tags & push them and finally publish the package on npmjs

Creating new plugins

Create a new directory inside this repository with the same structure as our template - eslint-plugin-prettier. We use lerna for publishing (See lernajs.io) - commit all your changes and mark the initial package version as 0.0.0. Once you run npm run publish lerna will prompt you for a version bump - select either 0.0.1 (unstable packages) or 1.0.0 (stable enough).

Creating new rules

In order to create a new rule, create a file named your-rule.js inside lib/rules and import & export it within index.js. For the structure inside your rule source, you can use the provided no-long-implicit-arrow.js rule as a template.

Resources in order to help you develop additional rules