Giter Site home page Giter Site logo

joggrdocs / eslint-config Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 173.29 MB

ESLint Configurations for the Joggr Team

Home Page: https://www.npmjs.com/package/@joggr/eslint-config

License: MIT License

JavaScript 8.48% Shell 1.13% TypeScript 90.40%
eslint eslint-config joggr

eslint-config's Introduction


ESLint configuration for Joggr projects.


npm version CodeQL Publish to npm CI
JS Semi-standard Style Prettier Style

Installation

Yarn

yarn add -D @joggr/eslint-config \
  eslint \
  @eslint/js \
  @types/eslint \
  @typescript-eslint/eslint-plugin \
  @typescript-eslint/parser \
  eslint-config-prettier \
  eslint-plugin-jest \
  eslint-config-standard-with-typescript \
  eslint-plugin-filenames-simple \
  eslint-plugin-import \
  eslint-plugin-n \
  eslint-plugin-promise

npm

npm install --save-dev @joggr/eslint-config \
  eslint \
  @eslint/js \
  @types/eslint \
  @typescript-eslint/eslint-plugin \
  @typescript-eslint/parser \
  eslint-config-prettier \
  eslint-plugin-jest \
  eslint-config-standard-with-typescript \
  eslint-plugin-filenames-simple \
  eslint-plugin-import \
  eslint-plugin-n \
  eslint-plugin-promise

Usage

.eslintrc.cjs

/** @type {import('eslint').Linter.Config} */
module.exports = {
  root: true,
  extends: ["@joggr/eslint-config"],
};

eslint@v9+

eslint.config.js

const { FlatCompat } = require("@eslint/eslintrc");

/** @type {import('eslint').Linter.Config} */
const config = {
  root: true,
  extends: ['@joggr/eslint-config'],
};

const compat = new FlatCompat();
module.exports = [
  ...compat.config(config)
];

React Project

Add additional packages.

yarn add -D eslint-plugin-react \
  eslint-plugin-react-hooks \
  eslint-plugin-react-refresh \
  eslint-plugin-storybook

.eslintrc.cjs

/** @type {import('eslint').Linter.Config} */
module.exports = {
  root: true,
  extends: ["@joggr/eslint-config/react"],
};

Node.js Project

.eslintrc.cjs

/** @type {import('eslint').Linter.Config} */
module.exports = {
  root: true,
  extends: ["@joggr/eslint-config/node"],
};

Adding Import Order Groups

You can add import order groups by extending the joggr config and overriding the import/order rule.

View File

/** @type {import('eslint').Linter.Config} */
module.exports = {
  root: true,
  extends: ['@joggr/eslint-config'],
  overrides: [
    {
      files: ['*'],
      rules: {
        'import/order': [
          'error',
          {
            pathGroups: [
              {
                pattern: '@lint/*',
                group: 'internal',
                position: 'before',
              },
            ],
          },
        ],
      },
    },
  ],
};

License

Licensed under MIT.



Want to sign up for Joggr?

We'd love to have you join, but we are in closed beta.
You can join our waitlist below.

eslint-config's People

Contributors

zrosenbauer avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

Seth Rosenbauer avatar

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.