Skip to content

Commit

Permalink
chore: prepare 93.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Dec 11, 2018
1 parent bb963d0 commit a16443c
Show file tree
Hide file tree
Showing 31 changed files with 526 additions and 555 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ 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).

## 93.0.0 - 2018-12-11

- Added: `react/forbid-foreign-prop-types` rule.
- Added: `react/no-unused-state` rule.
- Added: `react/destructuring-assignment` rule.
- Added: `lodash/collection-ordering` rule.
- Added: `mjs` extesion for `import/extensions` rules.
- Changed: `checkContextTypes` and `checkChildContextTypes` for `react/forbid-prop-types` rule.
- Changed: use `React` pragma.
- Changed: add `ignoreCase` to `react/jsx-no-duplicate-props` rule.
- Changed: disable `react/sort-prop-types` rule.
- Changed: disable `react/jsx-handler-names` rule.
- Changed: better order for `react/sort-comp` rule.
- Changed: disable `react/jsx-sort-props` rule.
- Changed: disable `react/jsx-sort-default-props` rule.
- Changed: disable `sort-keys` rule.

## 92.0.1 - 2018-12-07

- Fixed: `no-process-exit` should disable, but `recommended` preset of `eslint-plugin-node` enable rule.
Expand Down
8 changes: 8 additions & 0 deletions __tests__/all-rules/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require("path");

module.exports = {
extends: [path.resolve(__dirname, "../../lib/config/all.js")],
rules: {
"node/no-unsupported-features/es-syntax": "off"
}
};
28 changes: 28 additions & 0 deletions __tests__/all-rules/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";
import PropTypes from "prop-types";

class Greeting extends React.Component {
static propTypes = {
name: PropTypes.string.isRequired,
count: PropTypes.string.isRequired
};

constructor(props) {
super(props);

this.state = { count: props.count };
}

render() {
const { name } = this.props;
const { count } = this.state;

return (
<h1>
Hello, {name}, count ${count}!
</h1>
);
}
}

export default Greeting;
5 changes: 4 additions & 1 deletion __tests__/fixtures/react/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"env": {
"browser": true
},
"extends": ["../../../lib/config/react.js"],
"extends": [
"../../../lib/config/esnext.js",
"../../../lib/config/react.js"
],
"root": true
}
16 changes: 5 additions & 11 deletions __tests__/fixtures/react/App.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
import "./app.scss";
import Profile from "./Profile";
import React from "react";
import ReactDOM from "react-dom";
import SearchProfile from "./SearchProfile";
import Profile from "./Profile";
import "./app.scss";

class App extends React.Component {
constructor(props) {
super(props);

this.state = {
avatar: "",
followers: "",
following: "",
homeUrl: "",
location: "",
name: "",
notFound: "",
repos: "",
username: "hesmaili"
};
}

componentDidMount() {
SearchProfile.fetchProfile(this.state.username);
const { username } = this.state;

SearchProfile.fetchProfile(username);
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ test("integration tests for `esnext`", t => {

test("integration tests for `react`", t => {
const cli = new eslint.CLIEngine({
baseConfig: Object.assign({}, configs.react)
baseConfig: Object.assign({}, configs.esnext, configs.react)
});

const report = cli.executeOnFiles([
Expand Down
14 changes: 2 additions & 12 deletions lib/config/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const deprecatedRules = require("./rules/deprecated");
const ecmascript6Rules = require("./rules/ecmascript-6");
const importRules = require("./rules/import");
const jestRules = require("./rules/jest");
const lodashRules = require("./rules/lodash");
const jsxA11yRules = require("./rules/jsx-a11y");
const nodeRules = require("./rules/node");
const possibleErrorsRules = require("./rules/possible-errors");
Expand Down Expand Up @@ -57,23 +58,12 @@ module.exports = {
avaRules,
unicornRules,
jestRules,
lodashRules,
importRules,
promiseRules,
jsxA11yRules,
reactRules
),
extends: [
"eslint:recommended",
"plugin:ava/recommended",
"plugin:import/recommended",
"plugin:jsx-a11y/recommended",
"plugin:promise/recommended",
"plugin:unicorn/recommended",
"plugin:jest/recommended",
"plugin:lodash/recommended",
"plugin:node/recommended",
"plugin:react/recommended"
],
settings: {
react: {
version: "999.999.999"
Expand Down
1 change: 0 additions & 1 deletion lib/config/ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ module.exports = {
es6: true
},
plugins: ["ava"],
extends: ["plugin:ava/recommended"],
rules: Object.assign({}, avaRules)
};
5 changes: 0 additions & 5 deletions lib/config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ const unicornRules = require("./rules/unicorn");

module.exports = {
plugins: ["import", "unicorn"],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:unicorn/recommended"
],
env: {
es6: false
},
Expand Down
2 changes: 1 addition & 1 deletion lib/config/esnext.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ module.exports = {
allowImportExportEverywhere: true
},
plugins: ["promise"],
extends: [path.resolve(__dirname, "./core.js"), "plugin:promise/recommended"],
extends: [path.resolve(__dirname, "./core.js")],
rules: Object.assign({}, ecmascript6Rules, promiseRules)
};
1 change: 0 additions & 1 deletion lib/config/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ const jestRules = require("./rules/jest");
module.exports = {
env: { es6: true },
plugins: ["jest"],
extends: ["plugin:jest/recommended", "plugin:jest/style"],
rules: Object.assign({}, jestRules)
};
1 change: 0 additions & 1 deletion lib/config/lodash.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ const lodashRules = require("./rules/lodash");

module.exports = {
plugins: ["lodash"],
extends: ["plugin:lodash/recommended"],
rules: Object.assign({}, lodashRules)
};
1 change: 0 additions & 1 deletion lib/config/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = {
SharedArrayBuffer: false
},
plugins: ["node"],
extends: ["plugin:node/recommended"],
settings: {
node: {
tryExtensions: [".js", ".jsx", ".json", ".node"],
Expand Down
9 changes: 7 additions & 2 deletions lib/config/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module.exports = {
},
settings: {
react: {
pragma: "React",
version: "999.999.999"
}
},
plugins: ["react", "jsx-a11y"],
extends: ["plugin:react/recommended", "plugin:jsx-a11y/recommended"],
rules: Object.assign({}, reactRules, jsxA11yRules, {
"class-methods-use-this": [
"error",
Expand All @@ -37,12 +37,17 @@ module.exports = {
"getDefaultProps",
"getChildContext",
"componentWillMount",
"UNSAFE_componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"UNSAFE_componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"UNSAFE_componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount"
"componentWillUnmount",
"componentDidCatch",
"getSnapshotBeforeUpdate"
]
}
]
Expand Down
78 changes: 27 additions & 51 deletions lib/config/rules/ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,55 @@

module.exports = {
// Enforce passing correct arguments to assertions.
// In recommended
// "ava/assertion-arguments": "error",
"ava/assertion-arguments": "error",
// Limit the number of assertions in a test.
// In recommended
// "ava/max-asserts": ["off", 5],
"ava/max-asserts": ["off", 5],
// Ensure that async tests use await
// In recommended
// "ava/no-async-fn-without-await": "error",
"ava/no-async-fn-without-await": "error",
// Ensure no test.cb() is used.
// In recommended
// "ava/no-cb-test": "off",
"ava/no-cb-test": "off",
// Ensure tests do not have duplicate modifiers.
// In recommended
// "ava/no-duplicate-modifiers": "error",
"ava/no-duplicate-modifiers": "error",
// Ensure no tests have the same title.
// In recommended
// "ava/no-identical-title": "error",
"ava/no-identical-title": "error",
// Ensure no tests are written in ignored files.
// In recommended
// "ava/no-ignored-test-files": "error",
"ava/no-ignored-test-files": "error",
// Ensure no test files are imported anywhere
// In recommended
// "ava/no-import-test-files": "error",
"ava/no-import-test-files": "error",
// Ensure t.end() is only called inside test.cb().
// In recommended
// "ava/no-invalid-end": "error",
"ava/no-invalid-end": "error",
// Ensure no tests are nested.
// In recommended
// "ava/no-nested-tests": "error",
"ava/no-nested-tests": "error",
// Ensure no test.only() are present.
// In recommended
// "ava/no-only-test": "error",
"ava/no-only-test": "error",
// Ensure no assertions are skipped.
// In recommended
// "ava/no-skip-assert": "error",
"ava/no-skip-assert": "error",
// Ensure no tests are skipped.
// In recommended
// "ava/no-skip-test": "error",
"ava/no-skip-test": "error",
// Ensure t.end() is the last statement executed.
// In recommended
// "ava/no-statement-after-end": "error",
"ava/no-statement-after-end": "error",
// Ensure test.todo() is not given an implementation function.
// In recommended
// "ava/no-todo-implementation": "error",
/* eslint-enable */
"ava/no-todo-implementation": "error",
// Ensure no test.todo() is used.
/* eslint-enable */
"ava/no-todo-test": "error"
"ava/no-todo-test": "error",
// Prevent the use of unknown test modifiers.
// In recommended
// "ava/no-unknown-modifiers": "error",
"ava/no-unknown-modifiers": "error",
// Prefer using async/await instead of returning a Promise.
// In recommended
// "ava/prefer-async-await": "off",
// In `recommended` it is `error`, we need activate this in next major
// for `jest` too
"ava/prefer-async-await": "off",
// Allow only use of the asserts that have no power-assert alternative.
// In recommended
// "ava/prefer-power-assert": "off",
"ava/prefer-power-assert": "off",
// Ensure callback tests are explicitly ended.
// In recommended
// "ava/test-ended": "error",
"ava/test-ended": "error",
// Ensure tests have a title.
// In recommended
// "ava/test-title": ["error", "if-multiple"],
"ava/test-title": ["error", "if-multiple"],
// Prevent the incorrect use of t.
// In recommended
// "ava/use-t-well": "error",
"ava/use-t-well": "error",
// Ensure test functions use t as their parameter.
// In recommended
// "ava/use-t": "error",
"ava/use-t": "error",
// Ensure that AVA is imported with test as the variable name.
// In recommended
// "ava/use-test": "error",
"ava/use-test": "error",
// Ensure that t.true()/t.false() are used instead of t.truthy()/t.falsy().
// In recommended
// "ava/use-true-false": "error"
"ava/use-true-false": "error"
};
Loading

0 comments on commit a16443c

Please sign in to comment.