Skip to content

Commit

Permalink
New: Add eslint-plugin-eslint-plugin to plugin generator (#79)
Browse files Browse the repository at this point in the history
We want to encourage the adoption of [eslint-plugin-eslint-plugin](https://www.npmjs.com/package/eslint-plugin-eslint-plugin) to help ESLint plugin authors follow best practices including avoiding using deprecated APIs and producing rules with good usability.
  • Loading branch information
bmish committed Jul 2, 2021
1 parent f0e6ca5 commit 7714ede
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugin/index.js
Expand Up @@ -79,6 +79,7 @@ ESLintPluginGenerator.prototype.generate = function generate() {
mkdirp.sync("lib");
mkdirp.sync("tests");
mkdirp.sync("tests/lib");
this.template("_.eslintrc.js", ".eslintrc.js");
this.template("_plugin.js", "lib/index.js");
this.template("_package.json", "package.json");
this.template("_README.md", "README.md");
Expand Down
18 changes: 18 additions & 0 deletions plugin/templates/_.eslintrc.js
@@ -0,0 +1,18 @@
'use strict';

module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:eslint-plugin/recommended',
],
env: {
node: true,
},
overrides: [
{
files: ['tests/**/*.js'],
env: { mocha: true },
},
]
};
2 changes: 2 additions & 0 deletions plugin/templates/_package.json
Expand Up @@ -10,13 +10,15 @@
"author": "<%- userName.replace(/"/g, '\\"') %>",
"main": "lib/index.js",
"scripts": {
"lint": "eslint .",
"test": "mocha tests --recursive"
},
"dependencies": {
"requireindex": "~1.1.0"
},
"devDependencies": {
"eslint": "^7.1.0",
"eslint-plugin-eslint-plugin": "^3.2.0",
"mocha": "^9.0.0"
},
"engines": {
Expand Down

0 comments on commit 7714ede

Please sign in to comment.