From 78f761b85d2fbd716790f85e097ce7b0c3cbe7d1 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Sat, 2 Oct 2021 17:57:47 +0900 Subject: [PATCH] Chore: add generate new rule command --- docs/developer-guide/README.md | 5 +- package.json | 1 + tools/new-rule.js | 160 +++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 tools/new-rule.js diff --git a/docs/developer-guide/README.md b/docs/developer-guide/README.md index f08ecc3a8..c5bfcc99e 100644 --- a/docs/developer-guide/README.md +++ b/docs/developer-guide/README.md @@ -13,8 +13,7 @@ Please include as much detail as possible to help us properly address your issue In order to add a new rule or a rule change, you should: - Create issue on GitHub with description of proposed rule -- Generate a new rule using the [official yeoman generator](https://github.com/eslint/generator-eslint) -- Run `npm start` +- Generate a new rule using the `npm run new -- [rule-name]` command - Write test scenarios & implement logic - Describe the rule in the generated `docs` file - Make sure all tests are passing @@ -38,10 +37,12 @@ After opening [astexplorer.net], select `Vue` as the syntax and `vue-eslint-pars Since single file components in Vue are not plain JavaScript, we can't use the default parser, and we had to introduce additional one: `vue-eslint-parser`, that generates enhanced AST with nodes that represent specific parts of the template syntax, as well as what's inside the `