eslint-plugin-reiwa
What's this?
This is the eslint plugin to replace 平成 with 令和 which is new era in Japan.
Examples
reiwa/no-heisei-in-literal
// incorrectlet str = "heisei";str = "平成";str = "Heisei will ended during the GW of 2019 this year.";str = "平成の終わりは今年2019年のGW中になる見込みです。";
reiwa/no-heisei-in-variable-name
// incorrectconst theBeginningOfHeisei = 1989;let heisei;var 平成;
Getting started
Install
$ yarn add -D eslint-plugin-reiwa# or $ npm i -D eslint-plugin-reiwa
.eslintrc.js
Edit moduleexports = plugins: ... "reiwa" ... rules: "reiwa/no-heisei-in-literal": "error" "reiwa/no-heisei-in-variable-name": "error" ...
or
moduleexports = extends: "plugin:reiwa/recommended";
LICENSE
MIT