Skip to content

Commit afc0b10

Browse files
chore(release): 97.0.0
1 parent 7b41aeb commit afc0b10

File tree

7 files changed

+436
-199
lines changed

7 files changed

+436
-199
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
This project adheres to [Semantic Versioning](http://semver.org). Except add new
66
rule (it is breaking changed by default).
77

8+
## 97.0.0 - 2019-01-14
9+
10+
- Added: `unicorn/no-console-spaces` rule.
11+
- Added: `unicorn/prefer-node-append` rule.
12+
- Chore: minimum require `eslint-plugin-unicorn` version is now `^7.0.0`.
13+
- Removed: `react/no-did-mount-set-state` rule.
14+
- Removed: `unicorn/no-unsafe-regex` rule (due it is very unstable and annoying).
15+
816
## 96.0.0 - 2019-01-04
917

1018
- Added: `react/jsx-fragments` rule.

__tests__/fixtures/good.js

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable max-classes-per-file */
12
import { CLIEngine, linter } from "eslint";
23
import remarkConfig from "remark-preset-lint-itgalaxy";
34

@@ -384,6 +385,8 @@ async function fetchJson(url) {
384385

385386
return JSON.parse(text);
386387
} catch (error) {
388+
multiply(2, 1, 2, 3);
389+
387390
throw error;
388391
}
389392
}
@@ -596,11 +599,56 @@ Promise.all([Promise.resolve("a"), "b", Promise.resolve("c")])
596599
throw error;
597600
});
598601

602+
class Base {
603+
constructor(name) {
604+
this.name = name;
605+
}
606+
607+
sayHello() {
608+
return `Hello ${this.name}!`;
609+
}
610+
611+
sayGoodbye() {
612+
return `Goodbye ${this.name}!`;
613+
}
614+
615+
static logNbSides() {
616+
return "I have 4 sides";
617+
}
618+
619+
debug1() {
620+
console.log(this.name);
621+
}
622+
}
623+
624+
class MyClass extends Base {
625+
constructor(name, catName) {
626+
super(name);
627+
628+
this.catName = catName;
629+
}
630+
631+
getCatName() {
632+
return `Cat name is ${this.catName}`;
633+
}
634+
635+
debug2() {
636+
super.method1();
637+
638+
console.log(this.catName);
639+
}
640+
641+
static logDescription() {
642+
return `${super.logNbSides()} which are all equal`;
643+
}
644+
}
645+
599646
export default linter;
600647
export { foo, handler };
601648
export {
602649
age as ageExport,
603650
arrayVariable as arrayVariableExport,
604651
fooAsync,
605-
fooFuncExtra
652+
fooFuncExtra,
653+
MyClass
606654
};

__tests__/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,7 @@ alert("test");
324324

325325
test("integration tests for `esnext`", t => {
326326
const cli = new eslint.CLIEngine({
327-
baseConfig: Object.assign({}, configs.esnext, {
328-
rules: { "max-classes-per-file": "off" }
329-
}),
327+
baseConfig: Object.assign({}, configs.esnext),
330328
useEslintrc: false
331329
});
332330

lib/config/rules/react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = {
4949
// Prevent usage of deprecated methods
5050
"react/no-deprecated": "error",
5151
// Prevent usage of setState in componentDidMount
52-
"react/no-did-mount-set-state": "error",
52+
"react/no-did-mount-set-state": "off",
5353
// Prevent usage of setState in componentDidUpdate
5454
"react/no-did-update-set-state": "error",
5555
// Prevent usage of setState in componentWillUpdate

lib/config/rules/unicorn.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,20 @@ module.exports = {
5454
// Enforce passing a `message` value when throwing a built-in error.
5555
"unicorn/error-message": "error",
5656
// Disallow unsafe regular expressions.
57-
"unicorn/no-unsafe-regex": "error",
57+
"unicorn/no-unsafe-regex": "off",
5858
// Prefer `addEventListener` over `on`-functions.
5959
"unicorn/prefer-add-event-listener": "error",
6060
// Prefer the exponentiation operator over Math.pow()
61-
"unicorn/prefer-exponentiation-operator": "error"
61+
"unicorn/prefer-exponentiation-operator": "error",
62+
// Do not use leading/trailing space between `console.log` parameters.
63+
"unicorn/no-console-spaces": "error",
64+
// Disallow unreadable array destructuring.
65+
"unicorn/no-unreadable-array-destructuring": "off",
66+
// Disallow unused object properties.
67+
"unicorn/no-unused-properties": "off",
68+
// Prefer `append` over `appendChild`.
69+
"unicorn/prefer-node-append": "error",
70+
// Prefer `querySelector` over `getElementById`, `querySelectorAll` over g`etElementsByClassName` and `getElementsByTagName`
71+
// Need enable in future
72+
"unicorn/prefer-query-selector": "off"
6273
};

0 commit comments

Comments
 (0)