Have ideas to improve npm?Join in the discussion! »

eslint-plugin-reiwa

0.0.5 • Public • Published

eslint-plugin-reiwa

GitHub license NPM Version NPM Downloads build:

What's this?

This is the eslint plugin to replace 平成 with 令和 which is new era in Japan.

Examples

reiwa/no-heisei-in-literal

// incorrect
let str = "heisei";
str = "平成";
str = "Heisei will ended during the GW of 2019 this year.";
str = "平成の終わりは今年2019年のGW中になる見込みです。";

reiwa/no-heisei-in-variable-name

// incorrect
const theBeginningOfHeisei = 1989;
let heisei;
var 平成;

Getting started

Install

$ yarn add -D eslint-plugin-reiwa
# or 
$ npm i -D eslint-plugin-reiwa

Edit .eslintrc.js

module.exports = {
  plugins: [
    ...
    "reiwa",
    ...
  ],
  rules: {
    "reiwa/no-heisei-in-literal": "error",
    "reiwa/no-heisei-in-variable-name": "error",
    ...
  }
}

or

module.exports = {
  extends: ["plugin:reiwa/recommended"]
};

LICENSE

MIT

Install

npm i eslint-plugin-reiwa

DownloadsWeekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

8.08 kB

Total Files

9

Last publish

Collaborators

  • avatar