Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bmearns/eslint-config

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bmearns/eslint-config

Standard linter config for me.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-mearns

My eslint styling rules for NodeJS projects.

Use

# > npm install --save-dev git+https://github.com/mearns/eslint-config-mearns.git
> npm install --save-dev @bmearns/eslint-config
> npm install --save-dev eslint@8

Set your .eslintrc.json as follows:

{
    "extends": ["@bmearns/eslint-config"]
}

Optionally, but recommended:

> npm install --save-dev prettier pretty-quick husky

And merge the following into your package.json:

{
    "scripts": {
        "lint": "mearns-lint .",
        "pretty": "pretty-quick --staged"
    },
    "husky": {
        "hooks": {
            "pre-commit": "npm run pretty -s"
        }
    }
}

Overview

Parses ECMA Version 12, rules based on "JavaScript Standard Style" and Prettier (v3), but with semicolons.

The rules start with "standard" but we put semicolons back in because some people are really adverse to relying on ASI. Our rules require the use of semicolons to terminate statements, require a space after a semicolon and prohibit a space before a semicolon, and prohibit the use of extra-semicolons (semicolons that create empty statements).

We also use the "prettier/recommended" configuration and specifically set all prettier rules to "error" level (some default to "warning").

Finally, we add a "no-warning-comments" rule which will fail if any comment contains strings "FIXME", "TODO", or "XXX" (case-insensitive in all cases). This isn't to imply you shouldn't use comments like this, these rules allow you to use them to flag things that you need to fix before you merge or publish. However, these rules do imply that there shouldn't be any long-lived use of these comments: use an issue tracker for that.

Variations

If you're using jest, you might want to extends "@bmearns/eslint-config/jest"; this will set appropriate overrides for files under the test/ directory. Or if you're using jest with your test files adjacent to the source files they test, use "@bmearns/eslint-config/jest-adjacent" instead. This assumes your files are named like "foobar.test.ext".

If you're writing in typescript, you probably want to use "@bmearns/eslint-config/typescript", which will set appropriate overrides for typescript files (based on ".ts" extension). Note that you'll want to have this after the jest variant if you're using both.

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc