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

eslint-config-standard-kit

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-standard-kit

Standard.js linting rules - broken into modular pieces

  • 0.12.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslint-config-standard-kit

Standard.js is a fantastic collection of linter rules, but it difficult to integrate with other code-quality tools like Prettier, TypeScript, or Flow.

This package makes it easy to integrate Standard.js with these other tools by breaking its configuration into modular pieces. Just mix & match the bits you need for your particular setup:

  • standard-kit - Basic Standard.js rules
  • standard-kit/node - Node.js runtime support, including CommonJS features like require
  • standard-kit/jsx - JSX language support
  • standard-kit/typescript - TypeScript language support
  • standard-kit/flow - Flow language support

If you use a tool like Prettier to format your source code, just prefix the rule names with standard-kit/lint instead of standard-kit. This will remove all formatting rules, leaving just the code-quality rules.

For example, here is an .eslintrc.json that supports Prettier, JSX, and Typescript:

{
  "extends": [
    "standard-kit/lint",
    "standard-kit/lint/jsx",
    "standard-kit/lint/typescript"
  ],
  "parserOptions": {
    "project": "./tsconfig.json"
  }
}

Usage

First, add eslint-plugin-standard-kit as one of your project's devDependencies:

npm install --save-dev eslint-plugin-standard-kit

Depending on which configurations you enable, you will need to add several other dependencies as well:

  • basic rules:
    • eslint-plugin-import
    • eslint-plugin-promise
    • eslint-plugin-standard
  • node:
    • eslint-plugin-node
  • jsx:
    • eslint-plugin-react
  • typescript:
    • @typescript-eslint/parser
    • @typescript-eslint/eslint-plugin
  • flow:
    • babel-eslint
    • eslint-plugin-flowtype

Finally, edit your ESLint configuration file to enable your selected rules, as shown in the example above.

If you are using JSX or Typescript, you may want to pass the --ext option to ESlint to tell it about the .jsx or .ts file extensions:

eslint --ext .js,.jsx,.ts src/

The TypeScript rules also need to know where your tsconfig.json file is located. You can configure this using the parserOptions.project setting, as shown in the example above.

Rules

This package auto-generate its configuration files based on the official eslint-config-standard and eslint-config-standard-jsx packages. This means you are getting the exact same rules as the official Standard.js project, just filtered into smaller files.

Typescript support comes from the @typescript-eslint/eslint-plugin recommended settings, but with a few adjustments to be more in line with what Standard.js does (like using 2-space indents instead of 4).

Flow support uses the recommended settings from eslint-plugin-flowtype.

FAQs

Package last updated on 25 Apr 2019

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