Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alii/eslint-plugin-remix
An ESLint plugin for writing Remix.js Apps
https://github.com/alii/eslint-plugin-remix
eslint plugin react remix remix-run
Last synced: 11 days ago
JSON representation
An ESLint plugin for writing Remix.js Apps
- Host: GitHub
- URL: https://github.com/alii/eslint-plugin-remix
- Owner: alii
- Created: 2022-03-10T12:25:27.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-03T16:23:57.000Z (about 2 years ago)
- Last Synced: 2025-01-10T04:25:04.816Z (13 days ago)
- Topics: eslint, plugin, react, remix, remix-run
- Language: TypeScript
- Homepage: https://npm.im/eslint-plugin-remix
- Size: 1.73 MB
- Stars: 19
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# eslint-plugin-remix
An ESLint plugin for [Remix](https://remix.run)
## Installing
1. Firstly, install the dependency with Yarn `yarn add eslint-plugin-remix --dev` or with npm `npm install eslint-plugin-remix --save-dev`.
2. Add `remix` to your plugins array in your eslint configuration file.
3. Enable rules by writing `"remix/": "error"` in your eslint configuration file.## Rules:
### `node-server-imports`:
Ensures that all imports for known node builtins are only ever used in `.server.ts` files.
### `use-loader-data-types`:
When using TypeScript, this rule ensures that `useLoaderData` is passed a generic type of the loader function to explicitly declare what it returns. It is recommended you use this with [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks).
```ts
export const loader = ...;export default function Home() {
// Ensures that `` exists here
const data = useLoaderData();
}
```