Awesome
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/
..eslintignore
and.eslintrc.js
are 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 foo
command adds a rule definition.npm version
command updates the following stuff by themeta
property of rules:- the header of
docs/rules/*.md
. lib/configs/recommended.js
file.lib/index.js
file.- the rule table in
README.md
file.
- the header of
Below is an example of README.
eslint-plugin-xxxx (template)
<!-- [![npm version](https://img.shields.io/npm/v/eslint-plugin-xxxx.svg)](https://www.npmjs.com/package/eslint-plugin-xxxx) [![Downloads/month](https://img.shields.io/npm/dm/eslint-plugin-xxxx.svg)](http://www.npmtrends.com/eslint-plugin-xxxx) [![Build Status](https://travis-ci.org/mysticatea/eslint-plugin-xxxx.svg?branch=master)](https://travis-ci.org/mysticatea/eslint-plugin-xxxx) [![Coverage Status](https://codecov.io/gh/mysticatea/eslint-plugin-xxxx/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/eslint-plugin-xxxx) [![Dependency Status](https://david-dm.org/mysticatea/eslint-plugin-xxxx.svg)](https://david-dm.org/mysticatea/eslint-plugin-xxxx) -->A template for ESLint plugins.
Installation
Use npm or a compatibility tool to install.
$ npm install --save-dev eslint eslint-plugin-xxxx
Requirements
- Node.js v8.10.0 or newer versions.
- ESLint v5.16.0 or newer versions.
Usage
Write your config file such as .eslintrc.yml
.
plugins:
- xxxx
rules:
xxxx/example-rule: error
See also Configuring ESLint.
Configs
xxxx/recommended
... enables the recommended rules.
Rules
<!--RULE_TABLE_BEGIN-->Stylistic Issues
Rule ID | Description | |
---|---|---|
xxxx/example-rule | An example rule. | ⭐️ |
Semantic Versioning Policy
This plugin follows Semantic Versioning and ESLint's Semantic Versioning Policy.
Changelog
Contributing
Welcome your contribution!
See also ESLint Contribution Guide.
Development Tools
npm test
runs 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.