Skip to content

Shareable ESLint rules

License

Notifications You must be signed in to change notification settings

ferocia/eslint-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ferocia/eslint-plugin

Shareable ESLint Rules

Install

yarn add --dev @ferocia-oss/eslint-plugin

Configure

In 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',
}

Development

To work on this, check out the ESLint Plugin docs.

To run the tests in watch mode, run:

yarn dev

Publishing

  1. Bump the version in package.json and commit to main.
  2. Create a new release, creating a new tag with the same value as the package.json. Publish.
  3. An action will be triggered to automatically publish the package.