Shareable ESLint Rules
yarn add --dev @ferocia-oss/eslint-pluginIn your ESLint config file...
plugins: [
// ...
'@ferocia-oss',
]
rules: {
// ...
// Enforce `Readonly<{...}>` over `{readonly ...}` when there are multiple props.
'@ferocia-oss/prefer-generic-readonly': 'error',
// Enforce use of smart-quotes.
'@ferocia-oss/prefer-special-apostrophe': 'error',
// Enforce `Nullable<X>` over `X | null | undefined`.
// requires adding `declare type Nullable<T> = T | null | undefined`
// to your `global.d.ts`.
'@ferocia-oss/prefer-nullable': 'error',
}To work on this, check out the ESLint Plugin docs.
To run the tests in watch mode, run:
yarn dev- Bump the
versioninpackage.jsonand commit tomain. - Create a new release, creating a new tag with the same value as the
package.json. Publish. - An action will be triggered to automatically publish the package.