1.2.1 • Published 2 years ago

eslint-config-strict-mode v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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.

Brian Zalewski

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:

License

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

1.2.2

2 years ago

1.2.0

2 years ago

1.2.1

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago