Code Monkey home page Code Monkey logo

eslint-config-fuelrats's Introduction

FuelRats ESLint configs

Standard configurations for Fuel Rats ECMAScript projects

Note about v2

v2 Changes a number of aspects of our code style which may lead to time consuming adjustments, and in some cases an outright refactor of your code.

Please see PR #3 for a comprehensive list of changes made from v1.2.5

If you are a react user, @fuelrats/eslint-config-react no longer extends @fuelrats/eslint-config. See the react package README.md for more information.

Motivation

The TechRat team of The FuelRats utilize ECMAScript on all fronts. Over time these projects have strayed in code standards as no common base has been shared between them.

@fuelrats/eslint-config aims to help unify style and standards across all major FuelRats Javascript projects.

Packages

This config has two separate packages:

  • Base ESLint ruleset with @babel/eslint-parser as the primary parser. Generally intended for node.js backend projects.
    • Assumes an ECMAScript 2020 environment with Babel 7 as the primary transpiler.
    • Includes [@babel/eslint-plugin][eslint-plugin-babel] for providing core rule compatibility for common babel plugins.
    • Includes eslint-plugin-import for additional ESModule linting.
    • Includes eslint-plugin-jsdoc for JSDoc block linting.
    • Also includes a purejs preset which disables @babel/eslint-parser and [@babel/eslint-plugin][eslint-plugin-babel].

Installation

Development

This monorepo uses yarn workspaces to manage dependencies and versioning. When downloading for development, follow these steps:

  1. Clone the Repository
$ git clone https://github.com/FuelRats/eslint-config-fuelrats.git && cd eslint-config-fuelrats
  1. Let yarn install everything for you
$ yarn install
  1. Done! 🎉

Credits

Our code style and this config set was inspired by and derived from the AirBnB javascript style guide.

Send some love their way 😍🎉🎊

eslint-config-fuelrats's People

Contributors

uncleclapton avatar supermanifolds avatar dependabot[bot] avatar

Stargazers

Patch Fretté avatar

Watchers

 avatar James Cloos avatar Aki Loponen avatar  avatar Kenneth Aalberg avatar Andrew Bishop avatar NumberPi avatar

eslint-config-fuelrats's Issues

revising `no-debugger`

Seems like this config is being used out in the wild thanks to @trezy and his org trezy-studios.

Given this is that case we've begun getting feedback from others (Mainly @IanSSenne).

One point of contention has been the state of no-debugger. It's current config is:

    /**
     * disallow the use of debugger
     */
    'no-debugger': ['error'],

Under no circumstance do I think this rule should be turned off entirely. An unchecked debugger call in production can cause massive problems. Degrading to warn, however may have it's merits.

Below is just a collection of thoughts I've had on the topic

Good things about degrading to warn

  • Become more environment agnostic. Not all environments are breakpoint friendly due to various reasons (thanks webpack and your often borked HMR source maps).
  • warns can still break builds via strict linting when building on your CI

Bad things about degrading to warn

  • warns CAN be missed by CI/CD configurations that don't opt into into fail-on-warning.
  • warnings do not fully convey that it is essential to remove for production. To someone new to JS this can be confusing.

Problems with staying on error

  • This compels developers who need to use debugger to add a eslint-disable or eslint-disable-line comment to get around it so it may be used temporarily. This in turn becomes a much larger problem on it's own because now it is undetectable by any form of CI lint task. We have had this very same problem in the past with console.log()

Other thoughts

  • We cannot control the CI/CD configuration of other projects. This config is simply just not that opinionated on it's integration with your environment, and I think we have no intention on changing that.
  • Rule configurations should reflect our stance on the feature the rule enforces. Since we haven't established this yet, we should decide if things projects can do to make their use of a feature acceptable should have any bearing upon that stance. This will be something to discuss with @xlexi

Open for any feedback!

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.