Socket
Book a DemoInstallSign in
Socket

@offchainlabs/eslint-config-typescript

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@offchainlabs/eslint-config-typescript

Shareable Offchain labs eslint config

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
4
Created
Source

Eslint

Provide reusable typescript and react eslint configs

  • Install the peerDependencies of eslint configs:
npx install-peerdeps -Y --dev @offchainlabs/eslint-config-typescript
  • Usage

Eslint docs

eslintrc.js

require('@offchainlabs/eslint-config-typescript/base');
require('@offchainlabs/eslint-config-typescript/react');

module.exports = {
  extends: [
    '@offchainlabs/eslint-config-typescript/base',
    '@offchainlabs/eslint-config-typescript/react',
  ],
  // Override here
};

.eslintrc.yaml, .eslintrc.yml

extends:
  - '@offchainlabs/eslint-config-typescript/base'
  - '@offchainlabs/eslint-config-typescript/react'

rules:
  # Override here

.eslintrc.json

{
  extends: [
    '@offchainlabs/eslint-config-typescript/base',
    '@offchainlabs/eslint-config-typescript/react'
  ],
  overrides: [...]
}

package.json

"eslintConfig": {
  "extends": [
    "@offchainlabs/eslint-config-typescript/base",
    "@offchainlabs/eslint-config-typescript/react",
  ],
  "overrides": [...]
}

Note

For nextjs based project, "@offchainlabs/eslint-config-typescript/react" should be removed in favor of "@offchainlabs/eslint-config-typescript/next",. It includes react, react-hooks, jsx-a11y and import configurations already.

If you're using @offchainlabs/eslint-config-typescript/next in a project where Next.js isn't installed in your root directory (such as a monorepo), you need to update your .eslintrc:

{
  "extends": "next",
  "settings": {
    "next": {
      "rootDir": "packages/my-app/"
    }
  }
}

rootDir can be a path (relative or absolute), a glob (i.e. "packages/*/"), or an array of paths and/or globs.

see https://nextjs.org/docs/basic-features/eslint#rootdir

This repo can be linted with itself by running yarn run lint

FAQs

Package last updated on 04 Apr 2023

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