Thanks for your interest in improving this project! We welcome questions, bug reports, and feature requests. Please file an issue before submitting a PR, and fill out applicable details in the chosen issue template.
Please see our Code of Conduct before contributing.
This project uses pnpm
for package management. Run pnpm i
to install dependencies after cloning
the repo.
To type-check and build the code, run pnpm build
. This will also regenerate the docs from source
code descriptions and test cases, using scripts/docs.ts
.
pnpm lint
runs ESLint on the repo (so meta!).
Testing is extremely important to maintaining the quality of this project, so we require
comprehensive tests for every rule, and we check against example code provided in the docs. To run
tests for individual rules as well as integration/e2e tests, run pnpm test
. To run tests for a
specific rule like reactivity
, run pnpm test reactivity
or pnpm test reactivity --watch
.
Before releasing new versions, we run tests against various ESLint parsers with pnpm test:all
.
For each rule, there's a few things to do for it to be ready for release. Let's say you have
received approval to add a rule named solid/some-name
in an issue:
- Create
src/rules/some-name.ts
. Add the necessary imports and a default export of the form{ meta: { ... }, create() { ... } }
.solid/no-react-specific-props
is a good, brief example of what's necessary. - Create
test/rules/some-name.test.ts
. Addvalid
andinvalid
test cases, using other files for inspiration. Be sure toexport const cases
soscripts/docs.ts
can pick up the test cases. - Create
docs/rules/some-name.md
. You can copy the content ofdocs/rules/no-react-specific-props.md
directly, as all of its content is auto-generated. Runpnpm build
and then verify that the content has been updated to reflect the new rule. - When good tests are written and passing, open
src/index.ts
and import your new rule. Add it toallRules
and therecommended
andtypescript
configs as appropriate. - Submit your PR and await feedback. When any necessary changes have been made, it will be merged. Congratulations!
Publishing is currently done manually by @joshwilsonvu. When publishing a new version of
eslint-plugin-solid
, we also publish a corresponding version of eslint-plugin-standalone
, which
is a package primarily intended to support linting on https://playground.solidjs.com.