0.1.2 • Published 2 years ago
nrlint-plugin-rules-english-node-name v0.1.2
nrlint-plugin-rules-english-node-name
英語のノード名のみ許可するフローリンター用のカスタムルール
Node-REDフローエディタにインストールすると、以下のように英語のノード名でない場合に、警告を表示します。

グローバルメンバでフロー開発を行うプロジェクトにて、日本メンバに日本語を使ってほしくない場合に便利です。
フローエディタへのインストール方法
- Node-REDのホームディレクトリへ移動
cd ~/.node-red- フローリンターをインストール
npm install nrlint- カスタムルールをインストール
npm install nrlint-plugin-rules-english-node-name- Node-REDを起動
node-redCLI版フローリンターでの利用方法
- フローリンターをインストール
npm install -g nrlint- カスタムルールをインストール
npm install -g nrlint-plugin-rules-english-node-name- 下記を設定ファイル
.nrlintrc.jsに記載
module.exports = {
"plugins": [
"nrlint-plugin-rules-english-node-name"
],
"rules": {
"english-node-name": true
}
}- CLI版フローリンターを実行
nrlint flows.json-> flows.json内のノードに日本語の名前を付けていると、以下の様な警告メッセージが出力される
╔══════════════════╤══════════╤══════════════════════════════════════════════════╤═══════════════════╗
║ Object ID │ Severity │ Message │ Rule ║
╟──────────────────┼──────────┼──────────────────────────────────────────────────┼───────────────────╢
║ 33cf4f761bc66b31 │ warn │ ノード名は英数字、または記号である必要があります │ english-node-name ║
╚══════════════════╧══════════╧══════════════════════════════════════════════════╧═══════════════════╝
✖ 1 problems (0 errors, 1 warnings)