Git Product home page Git Product logo

eslint-config's Introduction

eslint-config

Build Status Coverage Status

MOXY's set of ESLint configuration packages to be used across several JavaScript projects.

How it works

This repository contains two sets of ESLint configurations to be used in JavaScript projects:

  • the base configuration, which defines the common ESLint rules, the ECMAScript version and the module system.
  • the enhancers, which contain specific settings for different frameworks, like React or Vue.

By using one or more of these packages, you can enforce the desired code styles for each type of project.

For more information on how to use each package and their specific configurations, please read the package's README by following the links below. You may also check the examples listed in Typical Configs to see how the packages may be combined for the most common scenarios.

Base config

The base config is published as @moxy/eslint-config-base, check out its README to know how to use it.

Enhancer configs

There are several enhancer packages, which are intended to be used in conjunction with the base configuration:

Typical configs

Standard JavaScript project
{
    "root": true,
    "env": {
        "browser": true
    },
    "extends": [
        "@moxy/eslint-config-base/esm",
        "@moxy/eslint-config-babel",
        "@moxy/eslint-config-jest"
    ]
}

ℹ️ If your project is isomorphic / universal, you may want to enable the node environment as well.

React web project
{
    "root": true,
    "env": {
        "browser": true
    },
    "extends": [
        "@moxy/eslint-config-base/esm",
        "@moxy/eslint-config-babel",
        "@moxy/eslint-config-react",
        "@moxy/eslint-config-react-web-a11y",
        "@moxy/eslint-config-jest"
    ]
}

ℹ️ If your project is Isomorphic / Universal, you may want to enable the node environment as well.

Node.js project
{
    "root": true,
    "env": {
        "node": true
    },
    "extends": [
        "@moxy/eslint-config-base/cjs/es2019",
        "@moxy/eslint-config-jest"
    ]
}

⚠️ In the above example, we choose the es2019 version instead of the latest ECMAScript version because there's no Babel compilation and we are restricted to what the Node.js runtime supports. Please check node.green and select the most appropriate ECMAScript version based on the Node.js version you are targeting.

React Native apps
{
    "root": true,
    "extends": [
        "@moxy/eslint-config-base/esm",
        "@moxy/eslint-config-babel",
        "@moxy/eslint-config-react",
        "@moxy/eslint-config-react-native",
        "@moxy/eslint-config-react-native-a11y",
        "@moxy/eslint-config-jest"
    ]
}

Older versions

If you want to read the changelog of an older version, please check here.

License

MIT License

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.