forked from mysticatea/template-eslint-plugin
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.src/rules/is the directory to put rule definitions.scripts/is the directory to put development scripts.tests/is the directory to put tests forsrc/..eslintignoreand.eslintrc.jsare the configuration to lint this repository.
Dependencies:
This template uses Jest and GitHub Actions 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 updatecommand updates the following stuff by themetaproperty of rules:- the header of
docs/rules/*.md. lib/configs/recommended.tsfile.lib/index.tsfile.- the rule table in
README.mdfile.
- the header of
Github Actions:
This template defines two workflows.
.github/workflows/lint.yaml- Run linting and testing for each commit.
.github/workflows/release.yaml- Release new packages when publish new release.
- You need to set
NPM_TOKENto repository secrets.
.github/workflows/release-drafter.yaml- Update draft release note by
release-drafter
- Update draft release note by
.github/workflows/dependabot-automerge.yaml- Merge PRs created by
dependabotautomatically.
- Merge PRs created by
Below is an example of README.
A template for ESLint plugins.
Use npm or a compatibility tool to install.
$ npm install --save-dev eslint-plugin-xxxx
Write your config file such as .eslintrc.
{
"plugins": ["xxxx"],
"rules": {
"xxxx/example-rule": "error"
}
}See also Configuring ESLint.
xxxx/recommended... enables the recommended rules.
| Rule ID | Description | recommended |
|---|---|---|
| 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.npm run updateupdates the package version. And it updatessrc/configs/recommended.ts,lib/index.ts, 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.