New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@basis-theory/eslint-config

Package Overview
Dependencies
Maintainers
10
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@basis-theory/eslint-config

Basis Theory ESLint config

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by14.29%
Maintainers
10
Weekly downloads
 
Created
Source

Basis Theory ESLint Config

Standardized Basis Theory ESLint and Prettier configurations.

Install

yarn add @basis-theory/eslint-config -D

Usage

Add it to extends property of your ESLint config file (i.e. .eslintrc.js):

module.exports = {
  extends: '@basis-theory',
  rules: {
    // disable/enable any rules
  },
};

Typescript

Instead of extending the root ruleset, point to the exported Typescript flavor:

module.exports = {
  extends: '@basis-theory/eslint-config/typescript',
  rules: {
    // disable/enable any rules
  },
};

Next.js

Instead of extending the root ruleset, point to the exported Next.js (Typescript) flavor:

module.exports = {
  extends: '@basis-theory/eslint-config/next',
  rules: {
    // disable/enable any rules
  },
};
Caveats

Since both eslint-config-get-off-my-lawn and eslint-config-next use same plugins with different versions, which leads to ESLint throwing the error:

ESLint couldn't determine the plugin "{pluginName}" uniquely.

So get over that, you must add Yarn resolutions field to your package.json:

{
  "resolutions": {
    "eslint-plugin-import": "2.24.2",
    "eslint-plugin-react": "7.25.1"
  }
}

Note: if you are using NPM, it is worth looking into (npm-force-resolutions)[https://www.npmjs.com/package/npm-force-resolutions] as an alternative to Yarn's deterministic dependency resolution.

Prettier

To use only the exported config in your project, you may set the prettier prop to your package.json:

{
  "prettier": "@basis-theory/eslint-config/prettier"
}

Or, if you want to expand on top it, create a .prettierrc.js file with following content:

module.exports = {
  ...require('@basis-theory/eslint-config/prettier'),
  // add your configuration here
};

Cheatsheet

@typescript-eslint/explicit-module-boundary-types and/or @typescript-eslint/explicit-module-boundary-types for a React component, add return type JSX.Element as follows:

Before:

export const MyComponent = ({}: Props) => {};

After:

export const MyComponent = ({}: Props): JSX.Element => {};

Keywords

FAQs

Package last updated on 10 May 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

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