Socket
Socket
Sign inDemoInstall

eslint-config-strict-mode

Package Overview
Dependencies
54
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-config-strict-mode

ESLint configuration for linting TS, JS, JSON, YAML, and TOML


Version published
Weekly downloads
127
decreased by-8.63%
Maintainers
1
Created
Weekly downloads
 

Readme

Source
Strict ESLint Config logo

A Strict, Awesome ESLint Config

A configuration managed by Megabyte Labs


ESLint configuration for linting TS, JS, JSON, YAML, and TOML

Table of Contents

Overview

This ESLint configuration package includes basically every quality ESLint plugin available. The default settings are meant to enforce strict design patterns among developers who code with TypeScript and JavaScript. It also includes linting rules for JSON, YAML, and TOML. Most of the rules include auto-fix functionality and it even sorts JSON and YAML. You can use this configuration as is or customize it to your liking so you can have your own shared ESLint configuration package!

Requirements

If you are simply including this library in your project, all you need is a recent version of Node.js. Node.js >14.18.0 is sometimes required and is the only version range we actively support. Albeit, it is highly probable that lower versions will work as well depending on the requirements that this project imports.

Developer Requirements

The following versions of Node.js and Python are required for development:

Other versions may work, but only the above versions are supported. Most development dependencies are installed automatically by our Taskfile.yml set-up (even Node.js and Python). Run bash start.sh to install Bodega (an improved fork of go-task) and run the initialization sequence. The taskfiles will automatically install dependencies as they are needed, based on what development tasks you are running. For more information, check out the CONTRIBUTING.md or simply run:

npm run help

npm run help will ensure Bodega is installed and then open an interactive dialog where you can explore and learn about various developer commands.

Usage

To make use of this configuration, you need to first install the configuration in your Node.js project:

npm install --save-dev eslint-config-strict-mode

After that, you need to include a reference to the package in your package.json:

{
  "name": "mynpmpackage",
  "version": "0.0.1",
  ...
  "eslintConfig": {
    "extends": "eslint-config-strict-mode"
  }
}

You can override the settings that are provided by the plugin by including additional rules in your package.json. For instance, if you wanted to turn off a rule named max-len, your package.json would look something like this:

{
  "name": "mynpmpackage",
  "version": "0.0.1",
  ...
  "eslintConfig": {
    "extends": "eslint-config-strict-mode",
    "rules": {
        "max-len": "off"
    }
  }
}

Plugins

The following ESLint plugins are included in this configuration:

ESLint PluginDescription
@typescript-eslint/eslint-pluginAn ESLint plugin which provides lint rules for TypeScript codebases
@typescript-eslint/eslint-plugin-tslintESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint
@typescript-eslint/parserAn ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code
eslint-config-prettierTurns off all rules that are unnecessary or might conflict with Prettier
eslint-formatter-git-logFormatter that displays results that include the name of the developer who is responsible for the error
eslint-formatter-gitlabFormatter for GitLab CI that integrates results into merge requests
eslint-formatter-prettyStylish formatter for terminal results that includes features such as clicking result to open code in editor
eslint-formatter-summaryAlternate formatting style for the results that displays a table
eslint-plugin-angularRules for Angular applications
eslint-plugin-array-funcRules for Array functions and methods
eslint-plugin-editorconfigAn ESLint plugin to enforce EditorConfig rules
eslint-plugin-eslint-commentsAdditional ESLint rules for ESLint directive comments
eslint-plugin-etcMore generalcpurpose TypeScript-related ESLint rules
eslint-plugin-exteslint extended rules
eslint-plugin-filenamesESLint plugin to check filenames
eslint-plugin-fpESLint rules for functional programming
eslint-plugin-functionalESLint plugin to disable mutation and promote functional programming in JavaScript and TypeScript
eslint-plugin-importESLint plugin with rules that help validate proper imports
eslint-plugin-jestESLint plugin for Jest
eslint-plugin-jest-asyncESLint rules for Jest to detect improper test assertions for asynchronous actions
eslint-plugin-jest-domLint DOM API performance
eslint-plugin-jest-formattingLinting rules for ESLint realted to code style formatting
eslint-plugin-jsdocRules that enforce comments written in JSDoc syntax
eslint-plugin-json-schema-validatorESLint plugin that validates data using JSON Schema Validator
eslint-plugin-jsoncESLint plugin for JSON, JSONC and JSON5 files
eslint-plugin-no-constructor-bindPrefer class arrow functions to binding in the constructor
eslint-plugin-no-explicit-type-exportsA plugin to guard against exporting imported types
eslint-plugin-no-secretsAn ESLint plugin to find strings that might be secrets or credentials
eslint-plugin-no-unsanitizedCustom ESLint rule to disallows unsafe innerHTML, outerHTML, insertAdjacentHTML and alike
eslint-plugin-no-use-extend-nativeESLint plugin to prevent use of extended native objects
eslint-plugin-nodeAdditional ESLint's rules for Node.js
eslint-plugin-optimize-regexOptimize regex literals
eslint-plugin-prefer-arrowESLint plugin to prefer arrow functions
eslint-plugin-prettierESLint plugin to prefer arrow functions
eslint-plugin-promiseEnforce best practices for JavaScript promises
eslint-plugin-regexpESLint plugin for finding RegExp mistakes and RegExp style guide violations
eslint-plugin-rxjsESLint rules for RxJS
eslint-plugin-securityESLint rules for Node Security
eslint-plugin-sonarjsSonarJS rules for ESLint
eslint-plugin-sort-class-membersESLint rule for enforcing consistent ES6 class member order
eslint-plugin-sort-keys-fixFork of eslint rule that sorts keys in objects with autofix enabled
eslint-plugin-switch-caseSwitch-case-specific linting rules for ESLint
eslint-plugin-tomlESLint plugin provides linting rules for TOML
eslint-plugin-tsdocThis ESLint plugin provides a rule for validating that TypeScript doc comments conform to the TSDoc specification
eslint-plugin-typescript-sort-keysA linter plugin to require sorting interface and string enum keys
eslint-plugin-unicornVarious awesome ESLint rules
eslint-plugin-unused-importsPackage to seperate no-unused-vars and no-unused-imports for ESLint as well as providing an autofixer for the latter
eslint-plugin-wokeESLint plugin to promote diversity and inclusion in codebases by restricting the presence of certain potentially offensive keywords
eslint-plugin-ymlESLint plugin provides linting rules for YAML

Most of the items in the chart above are plugins used for extending the core functionality of ESLint. These all start off with eslint-plugin-. However, there are a few items that begin with eslint-formatter-. These allow you to change the format that ESLint reports with. You can, for instance, run the following to change the format of the results:

eslint --format pretty --fix .

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page. If you would like to contribute, please take a look at the contributing guide.

Sponsorship

Dear Awesome Person,

I create open source projects out of love. Although I have a job, shelter, and as much fast food as I can handle, it would still be pretty cool to be appreciated by the community for something I have spent a lot of time and money on. Please consider sponsoring me! Who knows? Maybe I will be able to quit my job and publish open source full time.

Sincerely,

Brian Zalewski

Open Collective sponsors GitHub sponsors Patreon

Affiliates

Below you will find a list of services we leverage that offer special incentives for signing up for their services through our special links:

MailChimp DigitalOcean Referral Badge

License

Copyright © 2020-2021 Megabyte LLC. This project is MIT licensed.

Keywords

FAQs

Last updated on 02 Oct 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc