Contributing
git clone https://github.com/mohammadreza-zr/eslint-plugin-component-ownership.gitcd eslint-plugin-component-ownershipnpm installnpm test # builds, then runs every testLayout
Section titled “Layout”src/ index.ts the plugin: its name, its version and its rules ast.ts the loose node type the rules read rules/one-component-per-file.ts the rule rules/no-external-styling.ts the rule, its options and the built-in listexamples/ basic/ a small project with an ESLint config and the exact outputtest/ rules.test.mjs each rule with ESLint's RuleTester and the real TypeScript parser plugin.test.mjs the plugin loaded in a real flat config, and the options example.test.mjs the example project, run with the real eslint command docs.test.mjs checks the docs against the real fileswiki/ these pages- A change to a rule needs a valid and an invalid case in
rules.test.mjs, with a real line of code. - No project names in
src/. A policy of one project is an option. - Tests use real ESLint and the real parser. No mocks, stubs or fake timers.
- Docs are checked. A code block directly under
<!-- verbatim: path -->must consist of lines of that file, in order, and every wiki link written in double square brackets must point at a page.npm testfails when they do not. - A change to behaviour needs the wiki and
CHANGELOG.mdupdated.
Releasing
Section titled “Releasing”- Update
CHANGELOG.md. npm version patch(orminor,major) andgit push --follow-tags.- The
releaseworkflow checks that the tag equals the version inpackage.json, runs the typecheck and the tests on Node 20, 22 and 24, checks the type resolution, publishes to npm with provenance (trusted publishing, no token) and creates the GitHub release.
The first version of a new package has to be published by hand (npm publish --access public), because trusted publishing is set up on a package that exists. Then set it on npmjs.com: Settings → Trusted Publisher → GitHub Actions, user mohammadreza-zr, repository eslint-plugin, workflow release.yml, with direct npm publish allowed.
The wiki
Section titled “The wiki”wiki/ is the source. Publish it to the GitHub Wiki with:
npm run docs:syncGitHub creates the wiki repository only once a first page exists. Enable it in the repository settings (Features → Wikis) and create any page in the browser, then run the command; it replaces the pages.