Skip to content

Commit 07cb42b

Browse files
Sasha SushkoJahonta
andauthored
Релиз 5.0.0 (#73)
* Запретит присваивание в return (#65) https://app.clickup.com/t/rgc43n * Увеличит версию поддерживаемого стандарта ECMAScript (#63) * Добавит правило, запрещаюшее писать выражения без смысла (#64) https://app.clickup.com/t/n183gm * Удалит право на обязательную висячую запятую (#66) https://app.clickup.com/t/n1c2my * Разрешит не разделять пустой строкой однострочные свойства (#72) Co-authored-by: Lydia Zakharova <jahontis@gmail.com>
1 parent cc30dd1 commit 07cb42b

File tree

10 files changed

+27
-44
lines changed

10 files changed

+27
-44
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For validating **Vanilla JS** project use `vanilla` version:
1919
```json
2020
{
2121
"parserOptions": {
22-
"ecmaVersion": 2018,
22+
"ecmaVersion": 2019,
2323
"sourceType": "module"
2424
},
2525
"env": {
@@ -38,7 +38,7 @@ For validating **React** project use `react` version (`htmlacademy/react` includ
3838
```json
3939
{
4040
"parserOptions": {
41-
"ecmaVersion": 2018,
41+
"ecmaVersion": 2019,
4242
"sourceType": "module"
4343
},
4444
"env": {

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
5.0.0 / 2021-11-17
2+
==================
3+
4+
* Убрали запрет и требование висячей запятой. Теперь она по желанию
5+
* Подняли версию ES до 2019
6+
* Добавили новые правила
7+
* `no-unused-expressions`
8+
* `no-return-assign`
9+
110
4.1.0 / 2021-09-29
211
==================
312

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-htmlacademy",
3-
"version": "4.1.0",
3+
"version": "5.0.0",
44
"description": "ESLint shareable config for the HTML Academy style",
55
"files": [
66
"es5.js",

test/vanilla/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const config = require('../../vanilla');
33

44
config.parserOptions = {
5-
ecmaVersion: 2018,
5+
ecmaVersion: 2019,
66
sourceType: 'module',
77
};
88

test/vanilla/arrow-parens.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
() => {};
1+
const fn1 = () => {};
22

3-
(anything) => anything;
3+
const fn2 = (anything) => anything;
44

5-
(anything) => {
5+
const fn3 = (anything) => {
66
anything++;
77
return anything;
88
};
99

10-
(anything) => `${anything} \n`;
10+
const fn4 = (anything) => `${anything} \n`;
1111

1212
const emptyString = '';
1313

@@ -21,3 +21,5 @@ emptyString.then((anything) => {
2121
return anything;
2222
}
2323
});
24+
25+
throw new Error(fn1, fn2, fn3, fn4);

test/vanilla/comma-dangles.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/vanilla/eqeqeq.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable no-unused-expressions */
2+
13
const conditionLeft = 'str';
24
const conditionRight = 'str';
35

test/vanilla/prefer-arrow-callback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ doEnything(function() {
2525
});
2626

2727
doEnything(function() {
28-
this.key;
28+
doEnything(this.key);
2929
});
3030

3131
doEnything(function() {
32-
(() => this);
32+
(() => this)();
3333
});
3434

3535
const someObject = {};

vanilla.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = {
1414
'no-alert': 'error',
1515
'no-useless-concat': 'error',
1616
'no-useless-return': 'error',
17+
'no-unused-expressions': 'error',
18+
'no-return-assign': 'error',
1719
'radix': 'error',
1820
// Strict Mode
1921
// https://eslint.org/docs/rules/#strict-mode
@@ -26,16 +28,11 @@ module.exports = {
2628
// https://eslint.org/docs/rules/#stylistic-issues
2729
// ---------------------------------------------
2830
'camelcase': 'error',
29-
'comma-dangle': ['error', {
30-
'arrays': 'always-multiline',
31-
'objects': 'always-multiline',
32-
'functions': 'always-multiline',
33-
}],
3431
'eol-last': 'error',
3532
'indent': ['error', 2, {
3633
SwitchCase: 1,
3734
}],
38-
'lines-between-class-members': ['error', 'always'],
35+
'lines-between-class-members': ['error', 'always', {'exceptAfterSingleLine': true}],
3936
'no-multiple-empty-lines': 'error',
4037
'no-nested-ternary': 'error',
4138
'no-trailing-spaces': 'error',

0 commit comments

Comments
 (0)