Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-remix-react-routes

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-remix-react-routes

Validate routes referenced by <Link> and friends in a Remix app

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2.8K
decreased by-4.98%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-remix-react-routes

Validate routes referenced by <Link> and friends in a Remix app.

Installation

Remix apps generally have ESLint pre-configured, but if not you'll want to set it up:

npm i eslint --save-dev

Next, install eslint-plugin-remix-react-routes:

npm install eslint-plugin-remix-react-routes --save-dev

If your app uses TypeScript, you're encouraged to also configure typed linting (and set up typescript-eslint while you're at it!). This allows the plugin to fully leverage the type system when evaluating route expressions. To enable typed linting:

npm install @typescript-eslint/parser --save-dev

And add something along these lines to your .eslintrc.js:

module.exports = {
  // ...
  parser: "@typescript-eslint/parser",
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
  },
};

Configurations

Most apps should extend from one of the following configurations:

  • recommended: Recommended route rules that you can drop in to a Remix project.
  • strict: Like recommended, but more strict and opinionated.

Add something like this to your .eslintrc.js:

module.exports = {
  // ...
  extends: [
    // ...
    "plugin:remix-react-routes/recommended",
  ],
};

You can also override any config rules to meet your needs:

module.exports = {
  // ...
  rules: {
    // ...
    "remix-react-routes/no-relative-paths": [
      // downgrade to a warning
      "warn",
      // enable this check in route components
      { enforceInRouteComponents: true },
    ],
  },
};

Supported Rules

Keywords

FAQs

Package last updated on 21 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc