New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-ecmascript

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-ecmascript - npm Package Compare versions

Comparing version 1.3.0 to 2.0.0

105

index.js

@@ -13,10 +13,19 @@ module.exports = {

rules: {
// Enforce getter and setter pairs in objects and classes
'accessor-pairs': 'error',
// Enforce consistent spacing inside array brackets
'array-bracket-spacing': 'error',
// Enforce return statements in callbacks of array methods
'array-callback-return': 'error',
// Require parentheses around arrow function arguments
'arrow-parens': ['error', 'always'],
// Enforce consistent spacing before and after the arrow in arrow functions
'arrow-spacing': 'error',
// Disallow or enforce spaces inside of blocks after opening block and before closing block
'block-spacing': 'error',
// Enforce consistent brace style for blocks
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
// Enforce camelcase naming convention
'camelcase': 'error',
// Require or disallow trailing commas
'comma-dangle': ['error', {

@@ -29,15 +38,25 @@ 'arrays': 'always-multiline',

}],
// Enforce consistent spacing before and after commas
'comma-spacing': 'error',
// Enforce consistent comma style
'comma-style': 'error',
// Require return statements to either always or never specify values
'consistent-return': 'error',
// Enforce consistent brace style for all control statements
'curly': ['error', 'multi-line', 'consistent'],
// Enforce consistent newlines before and after dots
'dot-location': ['error', 'property'],
// Require or disallow newline at the end of files
'eol-last': 'error',
// Require the use of === and !==
'eqeqeq': ['error', 'smart'],
// Require or disallow spacing between function identifiers and their invocations
'func-call-spacing': 'error',
// Require function names to match the name of the variable or property to which they are assigned
'func-name-matching': 'error',
// Enforce consistent spacing around * operators in generator functions
'generator-star-spacing': 'error',
'global-require': 'error',
'handle-callback-err': 'error',
// Enforce the location of arrow function bodies
'implicit-arrow-linebreak': 'error',
// Enforce consistent indentation
'indent': ['error', 2, {

@@ -47,5 +66,9 @@ 'flatTernaryExpressions': true,

}],
// Enforce consistent spacing between keys and values in object literal properties
'key-spacing': 'error',
// Enforce consistent spacing before and after keywords
'keyword-spacing': 'error',
// Enforce consistent linebreak style
'linebreak-style': ['error', 'unix'],
// Enforce a maximum line length
'max-len': ['warn', {

@@ -59,74 +82,115 @@ 'code': 120,

}],
// Enforce or disallow parentheses when invoking a constructor with no arguments
'new-parens': 'error',
'newline-before-return': 'error',
// Disallow Array constructors
'no-array-constructor': 'error',
'no-buffer-constructor': 'error',
// Disallow the use of arguments.caller or arguments.callee
'no-caller': 'error',
// Disallow arrow functions where they could be confused with comparisons
'no-confusing-arrow': 'error',
'no-console': 'off',
'no-constant-condition': 'off',
// Disallow the use of console
'no-console': 'warn',
// Disallow duplicate module imports
'no-duplicate-imports': 'error',
'no-empty': 'error',
// Disallow extending native types
'no-extend-native': 'error',
// Disallow unnecessary calls to .bind()
'no-extra-bind': 'error',
// Disallow unnecessary labels
'no-extra-label': 'error',
'no-global-assign': 'error',
// Disallow use of this in contexts where the value of this is undefined
'no-invalid-this': 'error',
// Disallow the use of the __iterator__ property
'no-iterator': 'error',
// Disallow labeled statements
'no-labels': 'error',
// Disallow unnecessary nested blocks
'no-lone-blocks': 'error',
// Disallow if statements as the only statement in else blocks
'no-lonely-if': 'error',
// Disallow function declarations that contain unsafe references inside loop statements
'no-loop-func': 'error',
'no-mixed-requires': 'error',
'no-mixed-spaces-and-tabs': 'error',
// Disallow multiple empty lines
'no-multiple-empty-lines': ['error', {
'max': 2,
}],
// Disallow new operators outside of assignments or comparisons
'no-new': 'error',
// Disallow Object constructors
'no-new-object': 'error',
'no-new-require': 'error',
// Disallow new operators with the String, Number, and Boolean objects
'no-new-wrappers': 'error',
'no-path-concat': 'error',
'no-process-exit': 'error',
// Disallow the use of the __proto__ property
'no-proto': 'error',
// Disallow assignment operators in return statements
'no-return-assign': 'error',
'no-return-await': 'error',
// Disallow comparisons where both sides are exactly the same
'no-self-compare': 'error',
// Disallow comma operators
'no-sequences': 'error',
'no-shadow-restricted-names': 'error',
// Disallow throwing literals as exceptions
'no-throw-literal': 'error',
// Disallow trailing whitespace at the end of lines
'no-trailing-spaces': 'error',
// Disallow initializing variables to undefined
'no-undef-init': 'error',
// Disallow ternary operators when simpler alternatives exist
'no-unneeded-ternary': 'error',
'no-unsafe-negation': 'error',
// Disallow unused expressions
'no-unused-expressions': 'error',
// Disallow the use of variables before they are defined
'no-use-before-define': ['error', 'nofunc'],
// Disallow unnecessary calls to .call() and .apply()
'no-useless-call': 'error',
// Disallow unnecessary computed property keys in objects and classes
'no-useless-computed-key': 'error',
// Disallow unnecessary concatenation of literals or template literals
'no-useless-concat': 'error',
// Disallow unnecessary constructors
'no-useless-constructor': 'error',
// Disallow renaming import, export, and destructured assignments to the same name
'no-useless-rename': 'error',
// Disallow redundant return statements
'no-useless-return': 'error',
// Require let or const instead of var
'no-var': 'error',
// Disallow void operators
'no-void': 'error',
'no-with': 'error',
// Enforce consistent spacing inside braces
'object-curly-spacing': ['error', 'always'],
// Require or disallow method and property shorthand syntax for object literals
'object-shorthand': 'error',
// Enforce consistent linebreak style for operators
'operator-linebreak': ['error', 'before'],
// Require or disallow padding lines between statements
'padding-line-between-statements': [{ blankLine: 'always', prev: '*', next: 'return' }],
// Require const declarations for variables that are never reassigned after declared
'prefer-const': 'error',
// Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
'prefer-numeric-literals': 'error',
// Require using Error objects as Promise rejection reasons
'prefer-promise-reject-errors': ['error', {
'allowEmptyReject': true,
}],
// Require rest parameters instead of arguments
'prefer-rest-params': 'error',
// Require spread operators instead of .apply()
'prefer-spread': 'error',
// Require template literals instead of string concatenation
'prefer-template': 'error',
// Enforce the consistent use of either backticks, double, or single quotes
'quotes': ['error', 'single', {
'avoidEscape': true,
}],
// Disallow assignments that can lead to race conditions due to usage of await or yield
'require-atomic-updates': 'error',
// Enforce spacing between rest and spread operators and their expressions
'rest-spread-spacing': 'error',
// Require or disallow semicolons instead of ASI
'semi': ['error', 'always'],
// Enforce consistent spacing before and after semicolons
'semi-spacing': 'error',
// Enforce consistent spacing before blocks
'space-before-blocks': 'error',
// Enforce consistent spacing before function definition opening parenthesis
'space-before-function-paren': ['error', {

@@ -136,10 +200,17 @@ 'anonymous': 'always',

}],
// Enforce consistent spacing inside parentheses
'space-in-parens': 'error',
// Require spacing around infix operators
'space-infix-ops': 'error',
// Enforce consistent spacing before or after unary operators
'space-unary-ops': 'error',
// Enforce spacing around colons of switch statements
'switch-colon-spacing': 'error',
// Require or disallow spacing between template tags and their literals
'template-tag-spacing': 'error',
// Require or disallow spacing around the * in yield* expressions
'yield-star-spacing': 'error',
// Require or disallow "Yoda" conditions
'yoda': 'error',
},
};

4

package.json
{
"name": "eslint-config-ecmascript",
"version": "1.3.0",
"version": "2.0.0",
"main": "index.js",
"scripts": {},
"devDependencies": {
"eslint": "8.21.0"
"eslint": "8.31.0"
},

@@ -9,0 +9,0 @@ "peerDependencies": {

# eslint-config-ecmascript
[Eslint](https://eslint.org/) config based on `eslint:recommended` [rules](https://github.com/eslint/eslint/blob/main/conf/eslint-recommended.js).
To use it in your project, run:

@@ -16,4 +18,1 @@

```
- [npm package](https://www.npmjs.com/package/eslint-config-ecmascript)
- [eslint rules documentation](https://eslint.org/docs/latest/rules/)
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