Socket
Socket
Sign inDemoInstall

@vita-mojo/eslint-plugin-eslint

Package Overview
Dependencies
13
Maintainers
6
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vita-mojo/eslint-plugin-eslint

This library was generated with [Nx](https://nx.dev).


Version published
Maintainers
6
Created

Readme

Source

ESLint

This library was generated with Nx.

Installation

  1. Install the package:

    npm i --save-dev @vita-mojo/eslint-plugin-eslint

  2. Create an .eslintrc.json file in the root of the project with the following content:

    {
      "overrides": [
        {
          "extends": ["plugin:@vita-mojo/eslint/javascript"],
          "files": ["*.{js,jsx}"],
        },
        {
          "extends": ["plugin:@vita-mojo/eslint/browser", "plugin:@vita-mojo/eslint/react"],
          "files": ["src/*.{js,jsx,ts,tsx}"],
        },
        {
          "extends": ["plugin:@vita-mojo/eslint/node"],
          "files": ["scripts/*.{js,jsx,ts,tsx}"],
        },
        {
          "extends": ["plugin:@vita-mojo/eslint/service-worker"],
          "files": ["service-worker.js"]
        },
        {
          "extends": ["plugin:@vita-mojo/eslint/typescript", "plugin:@vita-mojo/eslint/prettier-typescript"],
          "files": ["*.{ts,tsx}"]
        },
        {
          "env": { "jest": true },
          "files": ["*.spec.{js,jsx,ts,tsx}", "*.test.{js,jsx,ts,tsx}"]
        },
        {
          "extends": ["plugin:@vita-mojo/eslint/prettier"],
          "files": ["*"]
        }
      ],
      "plugins": ["@vita-mojo/eslint"],
      "root": true
    }
    

    Some things to note about the config:

    • The plugin:@vita-mojo/eslint/prettier config must be extended last.

Extending the Rules

In the .eslintrc.json file, the default rules can be overridden with custom ones if desired. These rules should be set within an overrides block for the relevant file type.

The following is an example of what the config could look like if ts-ignore comments should be allowed:

"overrides": [
  {
    "files": ["*.{ts,tsx}"],
    "rules": {
      "@typescript-eslint/ban-ts-comment": "off",
      "@typescript-eslint/no-inferrable-types": "off"
  }
]

If you make use of custom components for HTML elements, it's worth adding them to the ESLint settings in order to get more accurate linting. For example:

"settings": {
  "jsx-a11y": {
    "components": {
      "Button": "button",
      "Image": "img",
      "Input": "input",
      "Link": "a"
    }
  }
}

For more information on this, see the eslint-plugin-jsx-a11y documentation.

Building

Run nx build eslint to build the library.

Running unit tests

Run nx test eslint to execute the unit tests via Jest.

FAQs

Package last updated on 09 Apr 2024

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc