This is a trial of GitHub Repository Template.
Please update package.json after you created new repository with this template.
File Structure:
docs/rules/is the directory to put documentation.lib/rules/is the directory to put rule definitions.scripts/is the directory to put development scripts.tests/lib/is the directory to put tests forlib/..eslintignoreand.eslintrc.jsare the configuration to lint this repository.
Dependencies:
This template uses mocha, nyc, and Travis CI for tests, as same as ESLint itself. If you want to use other tools, customize it.
Development Tools:
npm run add-rule foocommand adds a rule definition.npm versioncommand updates the following stuff by themetaproperty of rules:- the header of
docs/rules/*.md. lib/configs/recommended.jsfile.lib/index.jsfile.- the rule table in
README.mdfile.
- the header of
Below is an example of README.
A template for ESLint plugins.
Use npm or a compatibility tool to install.
$ npm install --save-dev eslint eslint-plugin-xxxx
- Node.js v8.10.0 or newer versions.
- ESLint v5.16.0 or newer versions.
Write your config file such as .eslintrc.yml.
plugins:
- xxxx
rules:
xxxx/example-rule: errorSee also Configuring ESLint.
xxxx/recommended... enables the recommended rules.
| Rule ID | Description | |
|---|---|---|
| xxxx/example-rule | An example rule. | ⭐️ |
This plugin follows Semantic Versioning and ESLint's Semantic Versioning Policy.
Welcome your contribution!
See also ESLint Contribution Guide.
npm testruns tests and measures coverage.npm version <TYPE>updates the package version. And it updateslib/configs/recommended.js,lib/index.js, andREADME.md's rule table. See also npm version CLI command.npm run add-rule <RULE_ID>creates three files to add a new rule.