Giter Site home page Giter Site logo

eslint-config's Introduction

@nkzw/eslint-config

Opinionated ESLint config with sensible defaults.

Installation & Usage

npm install @nkzw/eslint-config

In your .eslintrc.js or .eslintrc.cjs:

module.exports = {
  extends: ['@nkzw'],
};

Then run pnpm eslint . or npm eslint ..

Philosophy & Principles

Use this configuration if these principles resonate with you:

  • Error, Never Warn: People tend to ignore warnings. There is little value in only warning about potentially problematic code patterns. Either it's an issue or not. Errors force the developer to address the problem either by fixing it or explicitly disabling the role in that location.
  • Strict, consistent code style: If there are multiple ways of doing something, or there is a new language construct or best practice, this configuration will suggest the most strict and consistent solution.
  • Prevent Bugs: Problematic patterns such as instanceof are not allowed. This forces developers to choose more robust patterns. This configuration disallows usage of console or test.only so that you don't end up with unintended logging in production or CI failures. If you want to log to the console in your production app, use another function that calls console.log to distinguish between debug logs and intentional logs.
  • Fast: Slow rules are avoided if possible. For example, it is recommended to use the fast noUnusedLocals check in TypeScript instead of the no-unused-vars rules.
  • Don't get in the way: Rules that get in the way or are too subjective are disabled. Rules with autofixers are preferred over rules without them.

Included Plugins & Rules

This configuration consists of the most useful and least annoying rules from the following eslint plugins:

Suggestions

This configuration is meant to be used with:

Read more frontend tooling suggestions in this blog post.

eslint-config's People

Contributors

cpojer avatar ne3l avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fed ayagoumi dxu ne3l

eslint-config's Issues

Stylistic rules on the config

This configuration is meant to be used with Typescript and Prettier yet there are some stylistic rules on it:

is there any reason for not using https://github.com/prettier/eslint-config-prettier or can i open a PR cleaning up it?

just had a conflict between prettier and the Eslint autofix.

6:27 error Unexpected space before function parentheses space-before-function-paren

To reproduce:

  • Eslint: 8.56.0
  • Prettier: 3.2.2
export function Wrapper<
  T extends Record<string, (...args: any[]) => unknown>,
>(service: T) {}

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.