Skip to content

Commit

Permalink
chore: prepare 80.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Sep 25, 2018
1 parent e9ea016 commit c5dea2d
Show file tree
Hide file tree
Showing 8 changed files with 580 additions and 613 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org). Except add new
rule (it is breaking changed by default).

## 80.0.0 - 2018-09-25

- Chore: minimum require `eslint-plugin-lodash` version is now `^3.1.0`.
- Changed: use `recommended` rules for `lodash` preset, but disable all preference over native rules.
- Changed: use `999.999.999` version of `react` by default to avoid warning.

## 79.0.0 - 2018-08-29

- Chore: minimum require `babel-eslint` version is now `^9.0.0`.
Expand Down
1 change: 0 additions & 1 deletion __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ test("should load the `all` plugin config in the `eslint` to validate all rule s
"unicorn",
"html",
"jest",
"lodash",
"markdown",
"node",
"react"
Expand Down
12 changes: 8 additions & 4 deletions lib/config/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const ecmascript6Rules = require("./rules/ecmascript-6");
const importRules = require("./rules/import");
const jestRules = require("./rules/jest");
const jsxA11yRules = require("./rules/jsx-a11y");
const lodashRules = require("./rules/lodash");
const nodeRules = require("./rules/node");
const possibleErrorsRules = require("./rules/possible-errors");
const promiseRules = require("./rules/promise");
Expand Down Expand Up @@ -40,7 +39,8 @@ module.exports = {
"unicorn",
"html",
"jest",
"lodash",
// Exclude because we use `recommended` by default
// "lodash",
"markdown",
"node",
"react"
Expand All @@ -59,9 +59,13 @@ module.exports = {
jestRules,
importRules,
promiseRules,
lodashRules,
nodeRules,
jsxA11yRules,
reactRules
)
),
settings: {
react: {
version: "999.999.999"
}
}
};
1 change: 1 addition & 0 deletions lib/config/lodash.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ const lodashRules = require("./rules/lodash");

module.exports = {
plugins: ["lodash"],
extends: ["plugin:lodash/recommended"],
rules: Object.assign({}, lodashRules)
};
5 changes: 5 additions & 0 deletions lib/config/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ module.exports = {
ReactElement: true,
ReactClass: true
},
settings: {
react: {
version: "999.999.999"
}
},
plugins: ["react", "jsx-a11y"],
rules: Object.assign({}, reactRules, jsxA11yRules, {
"class-methods-use-this": [
Expand Down
94 changes: 9 additions & 85 deletions lib/config/rules/lodash.js
Original file line number Diff line number Diff line change
@@ -1,87 +1,16 @@
"use strict";

// see https://github.com/wix/eslint-plugin-lodash

module.exports = {
// Possible errors

// Use or avoid thisArg for Lodash method callbacks, depending on major version.
"lodash/callback-binding": "error",
// Use value returned from collection methods properly.
"lodash/collection-method-value": "error",
// Always return a value in iteratees of Lodash collection methods that aren't forEach.
"lodash/collection-return": "error",
// Do not use `.value()` on chains that have already ended (e.g. with `max()` or `reduce()`)
"lodash/no-double-unwrap": "error",
// Do not use superfluous arguments on Lodash methods with a specified arity.
"lodash/no-extra-args": "error",
// Do not use this inside callbacks without binding them.
"lodash/no-unbound-this": "error",
// Prevent chaining without evaluation via `value()` or non-chainable methods like `max()`.
"lodash/unwrap": "error",

// Stylistic issues

// Enforce a specific chain style: explicit, implicit, or explicit only when necessary.
"lodash/chain-style": ["error", "as-needed"],
"lodash/chaining": ["error", "always"],
// Enforce a specific function composition direction: `flow` or `flowRight`.
"lodash/consistent-compose": ["error", "flow"],
// Prefer identity shorthand syntax
"lodash/identity-shorthand": ["error", "always"],
// Prefer a specific import scope (e.g. `lodash/map` vs `lodash`)
"lodash/import-scope": "off",
// Prefer matches property shorthand syntax
"lodash/matches-prop-shorthand": ["error", "always"],
// Prefer matches shorthand syntax
"lodash/matches-shorthand": ["error", "always", 3, true],
// Do not use `.commit()` on chains that should end with `.value()`
"lodash/no-commit": "error",
// Enforce a specific path style for methods like get and property: array, string, or arrays only for deep paths.
"lodash/path-style": ["error", "string"],
// Prefer `_.compact()` over `_.filter()` for only truthy values.
"lodash/prefer-compact": "error",
// Prefer `_.filter()` over `_.forEach()` with an if statement inside.
"lodash/prefer-filter": ["error", 3],
// Prefer `_.find` over `_.filter` followed by selecting the first result.
"lodash/prefer-find": "error",
// Prefer `_.flatMap()` over consecutive map and flatten.
"lodash/prefer-flat-map": "error",
// Prefer using methods that do not mutate the source parameters, e.g. `_.without` instead of `_.pull`.
"lodash/prefer-immutable-method": "error",
// Prefer using `_.invoke()` over `_.map()` with a method call inside.
"lodash/prefer-invoke-map": "error",
// Prefer `_.map()` over `_.forEach()` with a push inside.
"lodash/prefer-map": "error",
// Prefer `_.reject()` over filter with `!(expression)` or `x.prop1 !== value`
"lodash/prefer-reject": ["error", 3],
// Prefer using `_.some()` over comparing `findIndex` to -1.
"lodash/prefer-some": [
2,
{
includeNative: true
}
],
// Prefer using `_.prototype.thru()` in the chain
// and not call functions in the initial value, e.g. `_(x).thru(f).map(g)`...
"lodash/prefer-thru": "error",
// Prefer using array and string methods in the chain and not the initial value, e.g. `_(str).split(' ')`...
"lodash/prefer-wrapper-method": "error",
// Prefer using main method names instead of aliases.
"lodash/preferred-alias": "error",
// Use/forbid property shorthand syntax.
"lodash/prop-shorthand": ["error", "always"],

// Preference over native

// Prefer `_.constant()` over functions returning literals.
"lodash/prefer-constant": "off",
// Prefer using `_.get()` or `_.has()` over expression chains like `a && a.b && a.b.c`.
"lodash/prefer-get": "error",
// Prefer using `_.get` or `_.has` over expression chains like `a && a.b && a.b.c`.
"lodash/prefer-get": "off",
// Prefer `_.includes()` over comparing `indexOf` to -1.
"lodash/prefer-includes": "off",
// Prefer `_.isNil()` over checks for both null and undefined.
"lodash/prefer-is-nil": "error",
// Prefer `_.isNil` over checks for both `null` and `undefined`.
"lodash/prefer-is-nil": "off",
// Prefer using Lodash chains (e.g. `_.map()`) over native and mixed chains.
"lodash/prefer-lodash-chain": "off",
// Prefer using Lodash collection methods (e.g. `_.map()`) over native array methods.
Expand All @@ -92,15 +21,10 @@ module.exports = {
"lodash/prefer-matches": "off",
// Prefer `_.noop()` over empty functions.
"lodash/prefer-noop": "off",
// Prefer `_.overSome()` and `_.overEvery()` instead of checks
// with && and || for methods that have a boolean check iteratee.
"lodash/prefer-over-quantifier": "error",
// Prefer `_.overSome` and `_.overEvery` instead of checks with `&&` and `||` for methods that have a boolean check iteratee.
"lodash/prefer-over-quantifier": "off",
// Prefer using `_.some` over comparing `findIndex` to -1.
"lodash/prefer-some": "off",
// Prefer `_.startsWith()` over `a.indexOf(b) === 0`.
"lodash/prefer-startswith": "off",
// Prefer `_.times()` over `_.map()` without using the iteratee's arguments.
"lodash/prefer-times": "error",

// Buggy, need remove in next release
"lodash/no-single-chain": "off",
"lodash/prefer-chain": "off"
"lodash/prefer-startswith": "off"
};
Loading

0 comments on commit c5dea2d

Please sign in to comment.