1. eslint-plugin-es5
ESLint plugin for ES5 users.
eslint-plugin-es5
Package: eslint-plugin-es5
Created by: nkt
Last modified: Fri, 17 Jun 2022 20:30:22 GMT
Version: 1.5.0
License: MIT
Downloads: 110,626
Repository: https://github.com/nkt/eslint-plugin-es5

Install

npm install eslint-plugin-es5
yarn add eslint-plugin-es5

eslint-plugin-es5

Build Status
Cult Of Martians

ESLint plugin for ES5 users.

Why?

Sometimes someone doesn't want to or can't use Babel.
Even if you support modern browsers or node.js, JS engines have bugs
like broken block-scoping.
Maybe you only want to forbid usage of for-of in your project.

If this concerns you, this plugin should help you.

Installation

npm install --save-dev eslint-plugin-es5

Usage

Add the plugin to your .eslintrc:

 {
  "plugins": [
    "es5"
  ]
}

And then any of the rules listed below like this:

 {
  "rules": {
    "es5/no-arrow-functions": "error"
  }
}

Also you can extend one of presets:

 {
  "extends": [
    "eslint:recommended",
    "plugin:es5/no-es2015"
  ]
}

Available presets:

  • plugin:es5/no-es2015: Forbid ES2015 usage.
  • plugin:es5/no-es2016: Forbid ES2016 usage.

List of supported rules

  • es5/no-es6-methods Forbid ES2015 methods for Array and String
  • es5/no-es6-static-methods Forbid ES2015 static methods for Array, Math, Number, and Object. You can enable specific functions: "es5/no-es6-static-methods": ["error", { exceptMethods: ["Math.imul"] }]
  • es5/no-arrow-functions:wrench:: Forbid arrow-functions.
  • es5/no-binary-and-octal-literals:wrench:: Forbid binary and octal literals.
  • es5/no-block-scoping: Forbid let and const declarations. You can enable them using options: "es5/no-block-scoping": ["error", { "let": true }]
  • es5/no-classes: Forbid ES2015 classes.
  • es5/no-computed-properties: Forbid computed properties.
  • es5/no-default-parameters: Forbid default parameters.
  • es5/no-destructuring:wrench:: Forbid destructuring statements.
  • es5/no-exponentiation-operator: Forbid exponentiation operator a ** b usage.
  • es5/no-for-of: Forbid for-of statements.
  • es5/no-generators: Forbid generators usage.
  • es5/no-modules: Forbid ES2015 modules usage.
  • es5/no-object-super: Forbid super/super.foo() calls.
  • es5/no-rest-parameters: Forbid rest parameters.
  • es5/no-shorthand-properties:wrench:: Forbid shorthand properties.
  • es5/no-spread:wrench:: Forbid ...spread expressions.
  • es5/no-template-literals:wrench:: Forbid template strings usage.
  • es5/no-typeof-symbol: Forbid typeof foo === 'symbol' checks.
  • es5/no-unicode-code-point-escape:wrench:: Forbid Unicode support in code point escape.
  • es5/no-unicode-regex: Forbid Unicode support in RegExp.

License

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin