Coder Social home page Coder Social logo

eslint-plugin's Introduction

@trevorblades/eslint-plugin

This package is the successor to my old ESLint config, @trevorblades/eslint-config. It's compatible with ESLint 8 and features a few major differences:

Installation

npm i -D @trevorblades/eslint-plugin

Usage

// .eslintrc.js
module.exports = {
  extends: ["plugin:@trevorblades/node"]
};

Configs

This plugin contains the following configs:

  • plugin:@trevorblades/node for basic JavaScript and Node.js projects
  • plugin:@trevorblades/react for React projects
  • plugin:@trevorblades/typescript for TypeScript projects
  • plugin:@trevorblades/graphql for projects that contain GraphQL files

The react config inherits rules and plugins from node, but typescript and graphql don't inherit any rules, and must be combined with the other configs for best results.

Prettier

In my old config, the base config included Prettier and the other configs extended it, and then added on other plugins and configs afterward. This isn't ideal, since the docs for eslint-plugin-prettier state that it must be included last in the array of extensions.

Now, users of these configs can combine them together, and then manually add Prettier support at the end of their own configs.

npm i -D eslint-plugin-prettier eslint-config-prettier
npm i --save-exact prettier
// .eslintrc.js
module.exports = {
  extends: [
    "plugin:@trevorblades/react",
    "plugin:@trevorblades/typescript",
    "plugin:@trevorblades/graphql",
    "plugin:prettier/recommended"
  ]
};

eslint-plugin's People

Contributors

trevorblades avatar

Watchers

 avatar  avatar

eslint-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.