@kablamo/eslint-plugin

2.0.1 • Public • Published

Kablamo eslint plugin

yarn add -D @kablamo/eslint-plugin

Add the following to your .eslintrc.js.

module.exports = {
  plugins: ["@kablamo"],
  extends: ["plugin:@kablamo/recommended"],
};

Rules

test-id-prefix-match-path

This rule fixes the first argument of createTestIds(prefix, [ ...ids]) to be a prefix derived from the files current directory. This ensures consistent unique prefixes per component.

You can still suffix variables to the end of your test id for example data-testid={\${testId.myId}-${uuid}`}`.

test-id-consistent-naming

This rule ensures common misspellings always get fixed to the kebab-case data-testid by default.

This can be configured to data-test-id.

module.exports = {
  plugins: ["@kablamo"],
  extends: ["plugin:@kablamo/recommended"],
  rules: {
    "@kablamo/test-id-consistent-naming": ["error", "data-test-id"],
  },
};

Configurations

This plugin contains a reccomended elsint ruleset to enable the included rules.

Developing

Run yarn test from the root of the project.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    181
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    181
  • 2.0.0
    0
  • 1.0.1
    8
  • 1.0.0
    0

Package Sidebar

Install

npm i @kablamo/eslint-plugin

Weekly Downloads

189

Version

2.0.1

License

MIT

Unpacked Size

10.4 kB

Total Files

8

Last publish

Collaborators

  • brycehanscomb
  • nhardy
  • walesey
  • glie163
  • ojkelly
  • kablamo-deployments