Socket
Socket
Sign inDemoInstall

eslint-config-airbnb-base

Package Overview
Dependencies
234
Maintainers
8
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 14.0.0 to 14.1.0

12

CHANGELOG.md

@@ -0,1 +1,13 @@

14.1.0 / 2020-03-12
==================
- [minor] add new disabled rules, update eslint
- [minor] enable `import/no-useless-path-segments` for commonjs (#2113)
- [fix] `whitespace`: only set erroring rules to "warn"
- Fix indentation with JSX Fragments (#2157)
- [patch] `import/no-extraneous-dependencies`: Support karma config files (#2121)
- [readme] normalize multiline word according to merriam-webster (#2138)
- [deps] update `eslint`, `eslint-plugin-import`, `eslint-plugin-react`, `object.entries`, `confusing-browser-globals`
- [dev deps] update `@babel/runtime`, `babel-preset-airbnb`, `safe-publish-latest`, `tape`
- [tests] re-enable eslint rule `prefer-destructuring` internally (#2110)
14.0.0 / 2019-08-09

@@ -2,0 +14,0 @@ ==================

22

package.json
{
"name": "eslint-config-airbnb-base",
"version": "14.0.0",
"version": "14.1.0",
"description": "Airbnb's base JS ESLint config, following our styleguide",

@@ -56,16 +56,16 @@ "main": "index.js",

"devDependencies": {
"@babel/runtime": "^7.5.5",
"babel-preset-airbnb": "^4.0.1",
"@babel/runtime": "^7.8.7",
"babel-preset-airbnb": "^4.4.0",
"babel-tape-runner": "^3.0.0",
"eclint": "^2.8.1",
"eslint": "^5.16.0 || ^6.1.0",
"eslint": "^5.16.0 || ^6.8.0",
"eslint-find-rules": "^3.4.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.20.1",
"in-publish": "^2.0.0",
"safe-publish-latest": "^1.1.2",
"tape": "^4.11.0"
"safe-publish-latest": "^1.1.4",
"tape": "^5.0.0-next.4"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.1.0",
"eslint-plugin-import": "^2.18.2"
"eslint": "^5.16.0 || ^6.8.0",
"eslint-plugin-import": "^2.20.1"
},

@@ -76,6 +76,6 @@ "engines": {

"dependencies": {
"confusing-browser-globals": "^1.0.7",
"confusing-browser-globals": "^1.0.9",
"object.assign": "^4.1.0",
"object.entries": "^1.1.0"
"object.entries": "^1.1.1"
}
}

@@ -26,3 +26,3 @@ module.exports = {

// specify curly brace conventions for all control statements
curly: ['error', 'multi-line'],
curly: ['error', 'multi-line'], // multiline

@@ -32,2 +32,6 @@ // require default case in switch statements

// https://eslint.org/docs/rules/default-param-last
// TODO: enable, semver-minor, when eslint v6.4 is required (which is a major)
'default-param-last': 'off',
// encourages use of dot notation whenever possible

@@ -44,2 +48,7 @@ 'dot-notation': ['error', { allowKeywords: true }],

// Require grouped accessor pairs in object literals and classes
// https://eslint.org/docs/rules/grouped-accessor-pairs
// TODO: enable in next major, altho the guide forbids getters/setters anyways
'grouped-accessor-pairs': 'off',
// make sure for-in loops have an if statement

@@ -62,2 +71,7 @@ 'guard-for-in': 'error',

// Disallow returning value in constructor
// https://eslint.org/docs/rules/no-constructor-return
// TODO: enable, semver-major
'no-constructor-return': 'off',
// disallow division operators explicitly at beginning of regular expression

@@ -320,2 +334,6 @@ // https://eslint.org/docs/rules/no-div-regex

// https://eslint.org/docs/rules/prefer-regex-literals
// TODO; enable, semver-minor, once eslint v6.4 is required (which is a major)
'prefer-regex-literals': 'off',
// require use of the second argument for parseInt()

@@ -322,0 +340,0 @@ radix: 'error',

@@ -41,2 +41,7 @@ module.exports = {

// Disallow duplicate conditions in if-else-if chains
// https://eslint.org/docs/rules/no-dupe-else-if
// TODO: enable, semver-major
'no-dupe-else-if': 'off',
// disallow duplicate keys when creating object literals

@@ -77,2 +82,6 @@ 'no-dupe-keys': 'error',

// https://eslint.org/docs/rules/no-import-assign
// TODO: enable, semver-minor, once eslint v6.4 is required (which is a major)
'no-import-assign': 'off',
// disallow function or variable declarations in nested blocks

@@ -101,2 +110,7 @@ 'no-inner-declarations': 'error',

// Disallow returning values from setters
// https://eslint.org/docs/rules/no-setter-return
// TODO: enable, semver-major (altho the guide forbids getters/setters already)
'no-setter-return': 'off',
// disallow sparse arrays

@@ -103,0 +117,0 @@ 'no-sparse-arrays': 'error',

@@ -93,2 +93,3 @@ module.exports = {

'**/protractor.conf.*.js', // protractor config
'**/karma.conf.js' // karma config
],

@@ -240,3 +241,3 @@ optionalDependencies: false,

// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
'import/no-useless-path-segments': 'error',
'import/no-useless-path-segments': ['error', { commonjs: true }],

@@ -243,0 +244,0 @@ // dynamic imports require a leading comment with a webpackChunkName

@@ -79,2 +79,6 @@ module.exports = {

// https://eslint.org/docs/rules/function-call-argument-newline
// TODO: enable, semver-minor, once eslint v6.2 is required (which is a major)
'function-call-argument-newline': ['off', 'consistent'],
// enforce spacing between functions and their invocations

@@ -143,3 +147,3 @@ // https://eslint.org/docs/rules/func-call-spacing

// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
ignoredNodes: ['JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
ignoredNodes: ['JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
ignoreComments: false

@@ -435,2 +439,7 @@ }],

// Disallow the use of Math.pow in favor of the ** operator
// https://eslint.org/docs/rules/prefer-exponentiation-operator
// TODO: enable, semver-major when eslint 5 is dropped
'prefer-exponentiation-operator': 'off',
// Prefer use of an object spread over Object.assign

@@ -437,0 +446,0 @@ // https://eslint.org/docs/rules/prefer-object-spread

const assign = require('object.assign');
const entries = require('object.entries');
const CLIEngine = require('eslint').CLIEngine;
const { CLIEngine } = require('eslint');
const baseConfig = require('.');
const severities = ['off', 'warn', 'error'];
function getSeverity(ruleConfig) {
if (Array.isArray(ruleConfig)) {
return getSeverity(ruleConfig[0]);
}
if (typeof ruleConfig === 'number') {
return severities[ruleConfig];
}
return ruleConfig;
}
function onlyErrorOnRules(rulesToError, config) {

@@ -15,4 +27,5 @@ const errorsOnly = assign({}, config);

const ruleConfig = rule[1];
const severity = getSeverity(ruleConfig);
if (rulesToError.indexOf(ruleName) === -1) {
if (rulesToError.indexOf(ruleName) === -1 && severity === 'error') {
if (Array.isArray(ruleConfig)) {

@@ -19,0 +32,0 @@ errorsOnly.rules[ruleName] = ['warn'].concat(ruleConfig.slice(1));

Sorry, the diff of this file is not supported yet

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