Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

nissy-dev/eslint-plugin-ts-template

 
 

Repository files navigation

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 for src/.
  • .eslintignore and .eslintrc.js are 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 foo command adds a rule definition.
  • npm update command updates the following stuff by the meta property of rules:
    • the header of docs/rules/*.md.
    • lib/configs/recommended.ts file.
    • lib/index.ts file.
    • the rule table in README.md file.

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_TOKEN to repository secrets.
  • .github/workflows/release-drafter.yaml
    • Update draft release note by release-drafter
  • .github/workflows/dependabot-automerge.yaml
    • Merge PRs created by dependabot automatically.

Below is an example of README.


eslint-plugin-xxxx (template)

A template for ESLint plugins.

Installation

Use npm or a compatibility tool to install.

$ npm install --save-dev eslint-plugin-xxxx

Usage

Write your config file such as .eslintrc.

{
  "plugins": ["xxxx"],
  "rules": {
    "xxxx/example-rule": "error"
  }
}

See also Configuring ESLint.

Configs

  • xxxx/recommended ... enables the recommended rules.

Rules

Rule ID Description recommended
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.
  • npm run update updates the package version. And it updates src/configs/recommended.ts, lib/index.ts, and README.md's rule table. See also npm version CLI command.
  • npm run add-rule <RULE_ID> creates three files to add a new rule.

About

A repository TypeScript template for ESLint plugins.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.4%
  • JavaScript 5.1%
  • Shell 0.5%