arui-presets-lint 5.10.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +0 -1
- package/.yarnrc +1 -0
- package/CHANGELOG.md +27 -0
- package/MIGRATION_GUIDE_V6.md +20 -0
- package/README.md +57 -54
- package/commitlint/index.js +2 -1
- package/eslint/index.js +13 -38
- package/package.json +79 -70
- package/release.config.js +4 -3
- package/stylelint/index.js +0 -12
- package/tsconfig.json +59 -59
- package/.prettierignore +0 -1
- package/commitlint.config.js +0 -3
package/.eslintignore
CHANGED
package/.yarnrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
save-prefix ""
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
# 6.0.0 (2022-07-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add .yarnrc aac625f
|
|
7
|
+
* bump semantic-release, change repository url e98a7bc
|
|
8
|
+
* update deps a90bac2
|
|
9
|
+
* update lint-staged and husky 1fe7d74
|
|
10
|
+
* **build:** remove github from release config 5c361e4
|
|
11
|
+
* **build:** remove repo from release config c8d28ca
|
|
12
|
+
* **commitlint:** increase body-max-line-length 006ca95
|
|
13
|
+
* **commitlint:** update commitlint libs d7bfec1
|
|
14
|
+
* **eslint:** forbid unnecessary template literals for best prettier compatibility eee9f53
|
|
15
|
+
* **eslint:** remove harmful eslint rules after testing 561115a
|
|
16
|
+
* **gitignore:** add .DS_Store to .gitignore 272ae54
|
|
17
|
+
* **package.json:** remove repo link from package.json 64b8068
|
|
18
|
+
* **stylelint:** update stylelint, remove stylelint-prettier a61f26f
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
* feat(eslint)!: update eslint and plugins, add eslint-config-prettier, remove prettier-eslint 0787329
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### BREAKING CHANGES
|
|
25
|
+
|
|
26
|
+
* dropping eslint <8 support, remove prettier-eslint
|
|
27
|
+
|
|
1
28
|
# [5.10.0](https://github.com/alfa-laboratory/arui-presets-lint/compare/v5.9.0...v5.10.0) (2021-11-01)
|
|
2
29
|
|
|
3
30
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Для успешной миграции на v6 с более ранних версий нужно:
|
|
2
|
+
|
|
3
|
+
1. Проверить, что в проекте стоит версия nodejs не ниже 12.20.0 / 14.13.1.
|
|
4
|
+
|
|
5
|
+
2. Удалить более неиспользуемые зависимости:
|
|
6
|
+
```sh
|
|
7
|
+
yarn remove prettier-eslint prettier-eslint-cli eslint-plugin-prettier
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
1. Добавить текущие зависимости [README.md](README.md)(##Установка)
|
|
11
|
+
|
|
12
|
+
2. Заменить вызовы prettier-eslint на prettier:
|
|
13
|
+
- в lint-staged [README.md](README.md)(## Конфигурация `husky` и `lint-staged`)
|
|
14
|
+
- в скриптах package.json [README.md](README.md)(## Конфигурация скриптов для запуска линтеров и форматтера в `package.json`)
|
|
15
|
+
|
|
16
|
+
3. (Опционально) Поменять подключаемый конфиг [README.md](README.md)(## Конфигурация всех линтеров через `package.json`). Что изменилось: в `eslintConfig.extends` больше не нужно писать `/index.js` в конце, а `commitlint.extends` теперь может быть строкой, а не массивом.
|
|
17
|
+
|
|
18
|
+
4. Выполнить команду `yarn format` и поправить возникающие ошибки (предупреждения в моменте править не обязательно, если не включен --max-warnings=0).
|
|
19
|
+
|
|
20
|
+
5. Сообщить остальным людям которые работают с проектом, что нужно доустановить зависимости (`yarn install`) и перенастроить IDE [README.md](README.md)(## Настройка IDE)
|
package/README.md
CHANGED
|
@@ -7,35 +7,36 @@
|
|
|
7
7
|
[license-img]: https://img.shields.io/badge/License-MIT-brightgreen.svg
|
|
8
8
|
[npm-img]: https://img.shields.io/npm/v/arui-presets-lint.svg
|
|
9
9
|
[npm]: https://www.npmjs.org/package/arui-presets-lint
|
|
10
|
-
[travis]: https://travis-ci.org/alfa-laboratory/arui-presets-lint?branch=master
|
|
11
|
-
[travis-img]: https://img.shields.io/travis/alfa-laboratory/arui-presets-lint/master.svg?label=unix
|
|
12
10
|
|
|
13
11
|
<br />
|
|
14
12
|
|
|
15
|
-
Набор конфигурационных файлов для валидации
|
|
13
|
+
Набор общих конфигурационных файлов для валидации react/node/typescript-проектов.
|
|
16
14
|
|
|
17
15
|
[Как я могу улучшить стандарты?](./.github/CONTRIBUTING.md)
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
Переходите с версии ниже чем 6.0.0? [Прочтите](MIGRATION_GUIDE_V6.md)
|
|
18
|
+
|
|
19
|
+
## Релизы
|
|
20
|
+
Данный проект использует [semantic-release](https://semantic-release.gitbook.io/semantic-release/).
|
|
21
21
|
|
|
22
|
+
Релизы публикуются руками. Если вам нужно выпустить новую версию библиотеки - выполните следующие действия (а лучше прикрутите сюда нормальный ci):
|
|
22
23
|
```
|
|
23
|
-
|
|
24
|
+
yarn --immutable
|
|
25
|
+
yarn semantic-release --no-ci
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
версии `1.11.0`.
|
|
28
|
+
## Установка
|
|
29
|
+
Для установки всех зависимостей проекта рекомендуется использовать [install-peerdeps](https://github.com/nathanhleung/install-peerdeps)
|
|
29
30
|
|
|
30
|
-
```
|
|
31
|
-
npx install-peerdeps
|
|
31
|
+
```sh
|
|
32
|
+
npx install-peerdeps --dev arui-presets-lint
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
Так же вы можете поставить все необходимые peerDependencies вручную. Для этого узнайте требуемые версии
|
|
35
36
|
с помощью команды
|
|
36
37
|
|
|
37
|
-
```
|
|
38
|
-
|
|
38
|
+
```sh
|
|
39
|
+
yarn info arui-presets-lint peerDependencies
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
И добавьте их себе в проект как dev зависимости.
|
|
@@ -46,13 +47,13 @@ npm info "arui-presets-lint@latest" peerDependencies
|
|
|
46
47
|
{
|
|
47
48
|
"prettier": "arui-presets-lint/prettier",
|
|
48
49
|
"eslintConfig": {
|
|
49
|
-
"extends": "./node_modules/arui-presets-lint/eslint
|
|
50
|
+
"extends": "./node_modules/arui-presets-lint/eslint"
|
|
50
51
|
},
|
|
51
52
|
"stylelint": {
|
|
52
53
|
"extends": "arui-presets-lint/stylelint"
|
|
53
54
|
},
|
|
54
55
|
"commitlint": {
|
|
55
|
-
"extends":
|
|
56
|
+
"extends": "./node_modules/arui-presets-lint/commitlint"
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
```
|
|
@@ -65,41 +66,45 @@ npm info "arui-presets-lint@latest" peerDependencies
|
|
|
65
66
|
"lint:css": "stylelint ./src/**/*.css",
|
|
66
67
|
"lint:scripts": "eslint \"**/*.{js,jsx,ts,tsx}\" --ext .js,.jsx,.ts,.tsx",
|
|
67
68
|
"lint": "yarn lint:css && yarn lint:scripts",
|
|
68
|
-
"
|
|
69
|
+
"lint:fix": "yarn lint:scripts --fix && yarn lint:css --fix",
|
|
70
|
+
"format": "prettier --ignore-path \"./.gitignore\" --write \"./**/*.{ts,tsx,js,jsx,css,json}\" && yarn lint:fix"
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
Если eslint пытается валидировать файлы, над которыми вы не имеете контроль, вы можете исключить
|
|
74
|
-
их с помощью
|
|
76
|
+
их с помощью [.eslintignore](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code#the-eslintignore-file)
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
.build
|
|
78
|
-
.idea
|
|
79
|
-
coverage
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Для запуска eslint рекомендуется использовать флаг [--max-warnings](https://eslint.org/docs/2.0.0/user-guide/command-line-interface#-max-warnings), который позволяет ограничить количество возникающих предупреждений.
|
|
78
|
+
Для запуска eslint рекомендуется использовать флаг [--max-warnings](https://eslint.org/docs/latest/user-guide/command-line-interface#--max-warnings), который позволяет ограничить количество возникающих предупреждений.
|
|
83
79
|
|
|
84
80
|
## Конфигурация `husky` и `lint-staged`:
|
|
85
81
|
|
|
86
82
|
```json
|
|
87
83
|
{
|
|
88
|
-
"lint-staged": {
|
|
89
|
-
"{src,config}/**/*.{js,jsx,ts,tsx}": ["prettier-eslint --write", "eslint"],
|
|
90
|
-
"*.css": ["prettier-eslint --write", "stylelint"]
|
|
91
|
-
},
|
|
92
84
|
"husky": {
|
|
93
85
|
"hooks": {
|
|
94
86
|
"pre-commit": "lint-staged",
|
|
95
87
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
96
88
|
}
|
|
97
|
-
}
|
|
89
|
+
},
|
|
90
|
+
"lint-staged": {
|
|
91
|
+
"*.{js,jsx,ts,tsx}": [
|
|
92
|
+
"prettier --write",
|
|
93
|
+
"eslint",
|
|
94
|
+
"yarn jest --findRelatedTests"
|
|
95
|
+
],
|
|
96
|
+
"*.css": ["prettier --write", "stylelint"],
|
|
97
|
+
"*.json": ["prettier --write"],
|
|
98
|
+
},
|
|
98
99
|
}
|
|
99
100
|
```
|
|
100
|
-
В lint-staged так же рекомендуется добавить запуск юнит-тестов, например, `yarn jest --findRelatedTests`
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
Рекомендуется изменить вызов husky.hooks.pre-commit на `tsc --noEmit --incremental false && lint-staged` для дополнительной проверки кода на ошибки typescript и добавить запуск юнит-тестов в lint-staged для скриптовых файлов `yarn jest --findRelatedTests`.
|
|
103
|
+
|
|
104
|
+
Также в lint-staged можно добавить флаги `--max-warnings=0` для stylelint и eslint, что не даст сделать коммит при наличии warning-а в коде (по умолчанию блокирует при наличии error).
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## Итоговая конфигурация линтеров
|
|
103
108
|
|
|
104
109
|
```json
|
|
105
110
|
{
|
|
@@ -107,11 +112,8 @@ coverage
|
|
|
107
112
|
"lint:css": "stylelint ./src/**/*.css",
|
|
108
113
|
"lint:scripts": "eslint \"**/*.{js,jsx,ts,tsx}\" --ext .js,.jsx,.ts,.tsx",
|
|
109
114
|
"lint": "yarn lint:css && yarn lint:scripts",
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
"lint-staged": {
|
|
113
|
-
"{src,config}/**/*.{js,jsx,ts,tsx}": ["prettier-eslint --write", "eslint"],
|
|
114
|
-
"*.css": ["prettier-eslint --write", "stylelint"]
|
|
115
|
+
"lint:fix": "yarn lint:scripts --fix && yarn lint:css --fix",
|
|
116
|
+
"format": "prettier --ignore-path \"./.gitignore\" --write \"./**/*.{ts,tsx,js,jsx,css,json}\" && yarn lint:fix"
|
|
115
117
|
},
|
|
116
118
|
"husky": {
|
|
117
119
|
"hooks": {
|
|
@@ -119,34 +121,35 @@ coverage
|
|
|
119
121
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
120
122
|
}
|
|
121
123
|
},
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
"lint-staged": {
|
|
125
|
+
"*.{js,jsx,ts,tsx}": [
|
|
126
|
+
"prettier --write",
|
|
127
|
+
"eslint",
|
|
128
|
+
"yarn jest --findRelatedTests"
|
|
129
|
+
],
|
|
130
|
+
"*.css": ["prettier --write", "stylelint"],
|
|
131
|
+
"*.json": ["prettier --write"],
|
|
128
132
|
},
|
|
129
|
-
"commitlint": {
|
|
130
|
-
"extends": ["./node_modules/arui-presets-lint/commitlint"]
|
|
131
|
-
}
|
|
132
133
|
}
|
|
133
134
|
```
|
|
134
135
|
|
|
135
|
-
## Настройка
|
|
136
|
-
|
|
137
|
-
https://
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
https://
|
|
142
|
-
|
|
136
|
+
## Настройка IDE:
|
|
137
|
+
1. Включить ESLint
|
|
138
|
+
- [Расширение для VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
|
|
139
|
+
- [Инструкция для Webstorm](https://www.jetbrains.com/help/webstorm/eslint.html#ws_js_eslint_activate)
|
|
140
|
+
2. Включить Stylelint
|
|
141
|
+
- [Расширение для VS Code](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
|
|
142
|
+
- [Инструкция для Webstorm](https://www.jetbrains.com/help/webstorm/using-stylelint-code-quality-tool.html#ws_stylelint_configure)
|
|
143
|
+
3. Включить Prettier
|
|
144
|
+
- [Расширение для VS Code](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
|
145
|
+
- [Инструкция для Webstorm](https://prettier.io/docs/en/webstorm.html)
|
|
143
146
|
|
|
144
147
|
## Лицензия
|
|
145
148
|
|
|
146
149
|
```
|
|
147
150
|
The MIT License (MIT)
|
|
148
151
|
|
|
149
|
-
Copyright (c)
|
|
152
|
+
Copyright (c) 2022 Alfa-Bank
|
|
150
153
|
|
|
151
154
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
152
155
|
of this software and associated documentation files (the "Software"), to deal
|
package/commitlint/index.js
CHANGED
package/eslint/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
parser: '@typescript-eslint/parser',
|
|
3
|
-
extends: [
|
|
3
|
+
extends: [
|
|
4
|
+
'airbnb',
|
|
5
|
+
'airbnb-typescript',
|
|
6
|
+
'airbnb/hooks',
|
|
7
|
+
'plugin:@typescript-eslint/recommended',
|
|
8
|
+
'prettier',
|
|
9
|
+
],
|
|
4
10
|
parserOptions: {
|
|
5
11
|
project: './tsconfig.json',
|
|
6
12
|
ecmaVersion: 2018,
|
|
@@ -35,42 +41,21 @@ module.exports = {
|
|
|
35
41
|
},
|
|
36
42
|
},
|
|
37
43
|
rules: {
|
|
38
|
-
quotes: ['warn', 'single', { avoidEscape: true }],
|
|
39
|
-
'comma-dangle': ['warn', 'always-multiline'],
|
|
40
|
-
'comma-spacing': ['warn', { before: false, after: true }],
|
|
41
|
-
'comma-style': ['warn', 'last'],
|
|
42
|
-
'computed-property-spacing': ['warn', 'never'],
|
|
43
|
-
'func-call-spacing': ['warn', 'never'],
|
|
44
|
-
indent: ['warn', 4, { SwitchCase: 1 }],
|
|
45
|
-
'key-spacing': ['warn'],
|
|
46
|
-
'no-trailing-spaces': ['warn'],
|
|
47
|
-
'no-whitespace-before-property': ['warn'],
|
|
44
|
+
quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
|
|
48
45
|
'padding-line-between-statements': [
|
|
49
46
|
'warn',
|
|
50
47
|
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
|
|
51
48
|
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
52
49
|
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
|
|
53
50
|
],
|
|
54
|
-
'quote-props': ['warn', 'as-needed'],
|
|
55
|
-
semi: ['warn'],
|
|
56
|
-
'semi-spacing': ['warn'],
|
|
57
|
-
'semi-style': ['warn'],
|
|
58
|
-
'space-before-blocks': ['warn'],
|
|
59
|
-
'space-in-parens': ['warn'],
|
|
60
|
-
'space-infix-ops': ['warn'],
|
|
61
|
-
'space-unary-ops': ['warn'],
|
|
62
|
-
'switch-colon-spacing': ['warn'],
|
|
63
51
|
'no-shadow': 'off',
|
|
64
|
-
// This rules conflicts with prettier formatter
|
|
65
|
-
'operator-linebreak': 'off',
|
|
66
|
-
'implicit-arrow-linebreak': 'off',
|
|
67
|
-
'max-len': 'off',
|
|
68
52
|
|
|
69
53
|
// Override default airbnb rules
|
|
70
54
|
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
71
55
|
'no-negated-condition': 'warn',
|
|
72
56
|
'default-case': 'off',
|
|
73
57
|
'no-use-before-define': 'off',
|
|
58
|
+
'prefer-regex-literals': 'off',
|
|
74
59
|
|
|
75
60
|
// code smell detection
|
|
76
61
|
complexity: ['warn', 20],
|
|
@@ -100,9 +85,6 @@ module.exports = {
|
|
|
100
85
|
],
|
|
101
86
|
|
|
102
87
|
// React
|
|
103
|
-
'react/jsx-indent': ['warn', 4],
|
|
104
|
-
'react/jsx-indent-props': ['warn', 4],
|
|
105
|
-
'react/jsx-curly-spacing': ['warn', { when: 'always', children: true }],
|
|
106
88
|
'react/jsx-fragments': ['warn', 'element'],
|
|
107
89
|
'react/static-property-placement': ['error', 'static public field'],
|
|
108
90
|
'react/state-in-constructor': ['error', 'never'],
|
|
@@ -115,6 +97,7 @@ module.exports = {
|
|
|
115
97
|
'react/destructuring-assignment': 'off',
|
|
116
98
|
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
|
|
117
99
|
'react/jsx-one-expression-per-line': 'off',
|
|
100
|
+
'react/function-component-definition': 'off',
|
|
118
101
|
|
|
119
102
|
// A11Y
|
|
120
103
|
'jsx-a11y/anchor-is-valid': ['warn', { aspects: ['invalidHref'] }],
|
|
@@ -124,22 +107,12 @@ module.exports = {
|
|
|
124
107
|
],
|
|
125
108
|
|
|
126
109
|
// typescript
|
|
127
|
-
'@typescript-eslint/indent': [
|
|
128
|
-
'warn',
|
|
129
|
-
4,
|
|
130
|
-
{
|
|
131
|
-
SwitchCase: 1,
|
|
132
|
-
ignoredNodes: ['TSTypeParameterInstantiation'],
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
110
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
136
111
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
137
112
|
'@typescript-eslint/array-type': [
|
|
138
113
|
'error',
|
|
139
114
|
{ default: 'array-simple', readonly: 'array-simple' },
|
|
140
115
|
],
|
|
141
|
-
'@typescript-eslint/type-annotation-spacing': 'error',
|
|
142
|
-
'@typescript-eslint/member-delimiter-style': 'error',
|
|
143
116
|
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
144
117
|
'@typescript-eslint/no-array-constructor': 'error',
|
|
145
118
|
'@typescript-eslint/no-empty-interface': 'error',
|
|
@@ -149,6 +122,7 @@ module.exports = {
|
|
|
149
122
|
'error',
|
|
150
123
|
{ functions: false, classes: true, variables: true },
|
|
151
124
|
],
|
|
125
|
+
'@typescript-eslint/default-param-last': 'off',
|
|
152
126
|
|
|
153
127
|
// Imports, file extensions
|
|
154
128
|
'import/no-extraneous-dependencies': [
|
|
@@ -172,7 +146,7 @@ module.exports = {
|
|
|
172
146
|
case: 'kebabCase',
|
|
173
147
|
},
|
|
174
148
|
],
|
|
175
|
-
'simple-import-sort/
|
|
149
|
+
'simple-import-sort/imports': [
|
|
176
150
|
'warn',
|
|
177
151
|
{
|
|
178
152
|
groups: [
|
|
@@ -196,6 +170,7 @@ module.exports = {
|
|
|
196
170
|
],
|
|
197
171
|
},
|
|
198
172
|
],
|
|
173
|
+
'import/no-import-module-exports': 'off',
|
|
199
174
|
},
|
|
200
175
|
overrides: [
|
|
201
176
|
{
|
package/package.json
CHANGED
|
@@ -1,92 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arui-presets-lint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Config files for arui-apps",
|
|
5
5
|
"author": "Good guys from Alfa-Bank",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@alfalab/stylelint-core-vars": "1.
|
|
9
|
-
"@commitlint/cli": "
|
|
10
|
-
"@commitlint/config-conventional": "
|
|
8
|
+
"@alfalab/stylelint-core-vars": "1.4.0",
|
|
9
|
+
"@commitlint/cli": "16.3.0",
|
|
10
|
+
"@commitlint/config-conventional": "16.2.4",
|
|
11
11
|
"arui-cssvars": "1.2.0",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"command-line-args": "5.1.1",
|
|
15
|
-
"conventional-changelog-cli": "2.1.0",
|
|
16
|
-
"conventional-github-releaser": "3.1.5",
|
|
17
|
-
"stylelint-config-prettier": "^8.0.2",
|
|
18
|
-
"stylelint-prettier": "^1.1.2"
|
|
12
|
+
"command-line-args": "5.2.1",
|
|
13
|
+
"conventional-changelog-cli": "2.2.2"
|
|
19
14
|
},
|
|
20
15
|
"peerDependencies": {
|
|
21
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
22
|
-
"@typescript-eslint/parser": "^
|
|
23
|
-
"eslint": "^
|
|
24
|
-
"eslint-config-airbnb": "^
|
|
25
|
-
"eslint-config-airbnb-typescript": "^
|
|
26
|
-
"eslint-
|
|
16
|
+
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
|
17
|
+
"@typescript-eslint/parser": "^5.30.6",
|
|
18
|
+
"eslint": "^8.20.0",
|
|
19
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
20
|
+
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
21
|
+
"eslint-config-prettier": "^8.5.0",
|
|
22
|
+
"eslint-import-resolver-typescript": "^3.3.0",
|
|
27
23
|
"eslint-plugin-cypress": "^2.12.1",
|
|
28
24
|
"eslint-plugin-dirnames": "^1.0.3",
|
|
29
|
-
"eslint-plugin-import": "^2.
|
|
30
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
31
|
-
"eslint-plugin-
|
|
32
|
-
"eslint-plugin-react": "^
|
|
33
|
-
"eslint-plugin-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"prettier
|
|
40
|
-
"prettier-eslint-cli": "^5.0.1",
|
|
41
|
-
"stylelint": "^13.13.1"
|
|
25
|
+
"eslint-plugin-import": "^2.26.0",
|
|
26
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
27
|
+
"eslint-plugin-react": "^7.30.1",
|
|
28
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
29
|
+
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
30
|
+
"eslint-plugin-unicorn": "^43.0.2",
|
|
31
|
+
"husky": "^4.3.8",
|
|
32
|
+
"lint-staged": "^12.5.0",
|
|
33
|
+
"prettier": "^2.7.1",
|
|
34
|
+
"stylelint": "^14.9.1",
|
|
35
|
+
"stylelint-config-prettier": "^9.0.3"
|
|
42
36
|
},
|
|
43
37
|
"devDependencies": {
|
|
38
|
+
"@alfalab/core-components": "28.6.0",
|
|
44
39
|
"@semantic-release/changelog": "5.0.1",
|
|
45
40
|
"@semantic-release/commit-analyzer": "8.0.1",
|
|
46
|
-
"@semantic-release/git": "9.0.
|
|
47
|
-
"@semantic-release/
|
|
48
|
-
"@semantic-release/
|
|
49
|
-
"@
|
|
50
|
-
"@typescript-eslint/
|
|
51
|
-
"
|
|
52
|
-
"eslint": "
|
|
53
|
-
"eslint-config-airbnb": "
|
|
54
|
-
"eslint-config-airbnb-typescript": "
|
|
55
|
-
"eslint-
|
|
41
|
+
"@semantic-release/git": "9.0.1",
|
|
42
|
+
"@semantic-release/npm": "7.1.3",
|
|
43
|
+
"@semantic-release/release-notes-generator": "9.0.3",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "5.30.6",
|
|
45
|
+
"@typescript-eslint/parser": "5.30.6",
|
|
46
|
+
"arui-feather": "19.2.2",
|
|
47
|
+
"eslint": "8.20.0",
|
|
48
|
+
"eslint-config-airbnb": "19.0.4",
|
|
49
|
+
"eslint-config-airbnb-typescript": "17.0.0",
|
|
50
|
+
"eslint-config-prettier": "8.5.0",
|
|
51
|
+
"eslint-import-resolver-typescript": "3.3.0",
|
|
56
52
|
"eslint-plugin-cypress": "2.12.1",
|
|
57
53
|
"eslint-plugin-dirnames": "1.0.3",
|
|
58
|
-
"eslint-plugin-import": "2.
|
|
59
|
-
"eslint-plugin-jsx-a11y": "
|
|
60
|
-
"eslint-plugin-
|
|
61
|
-
"eslint-plugin-react": "
|
|
62
|
-
"eslint-plugin-
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"lint-staged": "
|
|
67
|
-
"prettier": "2.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"stylelint": "
|
|
54
|
+
"eslint-plugin-import": "2.26.0",
|
|
55
|
+
"eslint-plugin-jsx-a11y": "6.6.1",
|
|
56
|
+
"eslint-plugin-react": "7.30.1",
|
|
57
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
58
|
+
"eslint-plugin-simple-import-sort": "7.0.0",
|
|
59
|
+
"eslint-plugin-unicorn": "43.0.2",
|
|
60
|
+
"husky": "4.3.8",
|
|
61
|
+
"kebab-case": "1.0.0",
|
|
62
|
+
"lint-staged": "12.5.0",
|
|
63
|
+
"prettier": "2.7.1",
|
|
64
|
+
"react": "17.0.1",
|
|
65
|
+
"semantic-release": "17.4.7",
|
|
66
|
+
"stylelint": "14.9.1",
|
|
67
|
+
"stylelint-config-prettier": "9.0.3",
|
|
72
68
|
"typescript": "4.4.4"
|
|
73
69
|
},
|
|
74
70
|
"scripts": {
|
|
75
|
-
"github-release": "conventional-github-releaser -p angular",
|
|
76
71
|
"lint": "eslint ./",
|
|
77
72
|
"precommit": "lint-staged",
|
|
78
73
|
"test": "yarn test:eslint && yarn test:stylelint",
|
|
79
|
-
"test:eslint": "eslint \"./test/**/*.{ts,tsx,js,jsx}\"",
|
|
80
|
-
"test:stylelint": "node ./test/stylelint-test.js",
|
|
81
|
-
"
|
|
74
|
+
"test:eslint": "yarn eslint:prettier-conflicts-check && eslint \"./test/**/*.{ts,tsx,js,jsx}\"",
|
|
75
|
+
"test:stylelint": "yarn stylelint:prettier-conflicts-check && node ./test/stylelint-test.js",
|
|
76
|
+
"stylelint:prettier-conflicts-check": "stylelint-config-prettier-check",
|
|
77
|
+
"eslint:prettier-conflicts-check": "eslint-config-prettier ./eslint/index.js",
|
|
78
|
+
"format": "prettier --ignore-path \"./.gitignore\" --write \"./**/*.{ts,tsx,js,jsx,css,json}\""
|
|
82
79
|
},
|
|
83
80
|
"lint-staged": {
|
|
84
|
-
"**/*.{js,jsx,ts,tsx,
|
|
85
|
-
"prettier
|
|
86
|
-
"eslint"
|
|
81
|
+
"**/*.{js,jsx,ts,tsx,json}": [
|
|
82
|
+
"prettier --write",
|
|
83
|
+
"eslint --fix --max-warnings=0"
|
|
87
84
|
],
|
|
88
85
|
"stylelint/*.js": [
|
|
89
|
-
"prettier
|
|
86
|
+
"prettier --write",
|
|
90
87
|
"yarn test:stylelint"
|
|
91
88
|
]
|
|
92
89
|
},
|
|
@@ -101,18 +98,30 @@
|
|
|
101
98
|
"kind-of": ">= 6.0.3",
|
|
102
99
|
"minimist": ">= 1.2.3"
|
|
103
100
|
},
|
|
104
|
-
"repository": {
|
|
105
|
-
"type": "git",
|
|
106
|
-
"url": "git+https://github.com/alfa-laboratory/arui-presets-lint.git"
|
|
107
|
-
},
|
|
108
|
-
"bugs": {
|
|
109
|
-
"url": "https://github.com/alfa-laboratory/arui-presets-lint/issues"
|
|
110
|
-
},
|
|
111
101
|
"husky": {
|
|
112
102
|
"hooks": {
|
|
113
103
|
"pre-commit": "yarn test",
|
|
114
104
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
115
105
|
}
|
|
116
106
|
},
|
|
117
|
-
"prettier": "./prettier
|
|
107
|
+
"prettier": "./prettier",
|
|
108
|
+
"stylelint": {
|
|
109
|
+
"extends": "./stylelint"
|
|
110
|
+
},
|
|
111
|
+
"eslintConfig": {
|
|
112
|
+
"extends": "./eslint",
|
|
113
|
+
"rules": {
|
|
114
|
+
"import/no-extraneous-dependencies": [
|
|
115
|
+
"error",
|
|
116
|
+
{
|
|
117
|
+
"devDependencies": [
|
|
118
|
+
"test/**/*"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"commitlint": {
|
|
125
|
+
"extends": "./commitlint"
|
|
126
|
+
}
|
|
118
127
|
}
|
package/release.config.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
plugins: [
|
|
3
3
|
'@semantic-release/commit-analyzer',
|
|
4
|
-
'@semantic-release/release-notes-generator',
|
|
4
|
+
['@semantic-release/release-notes-generator', {
|
|
5
|
+
'linkReferences': false,
|
|
6
|
+
'linkCompare': false,
|
|
7
|
+
}],
|
|
5
8
|
'@semantic-release/changelog',
|
|
6
|
-
'@semantic-release/github',
|
|
7
9
|
'@semantic-release/npm',
|
|
8
10
|
'@semantic-release/git',
|
|
9
11
|
],
|
|
10
12
|
branches: ['master'],
|
|
11
|
-
repositoryUrl: 'https://github.com/alfa-laboratory/arui-presets-lint',
|
|
12
13
|
};
|
package/stylelint/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
extends: [require.resolve('stylelint-prettier/recommended')],
|
|
3
2
|
rules: {
|
|
4
3
|
'arui-cssvars/use-variables': true,
|
|
5
4
|
'block-no-empty': true,
|
|
@@ -32,8 +31,6 @@ module.exports = {
|
|
|
32
31
|
'media-feature-range-operator-space-before': 'always',
|
|
33
32
|
'no-empty-source': true,
|
|
34
33
|
'no-invalid-double-slash-comments': true,
|
|
35
|
-
'selector-attribute-operator-space-after': 'never',
|
|
36
|
-
'selector-attribute-operator-space-before': 'never',
|
|
37
34
|
'selector-pseudo-class-no-unknown': true,
|
|
38
35
|
'selector-pseudo-element-colon-notation': 'single',
|
|
39
36
|
'selector-pseudo-element-no-unknown': true,
|
|
@@ -43,15 +40,6 @@ module.exports = {
|
|
|
43
40
|
'string-no-newline': true,
|
|
44
41
|
'unit-no-unknown': true,
|
|
45
42
|
|
|
46
|
-
'declaration-bang-space-after': 'never',
|
|
47
|
-
'declaration-bang-space-before': 'always',
|
|
48
|
-
'selector-attribute-brackets-space-inside': 'never',
|
|
49
|
-
'selector-attribute-quotes': 'always',
|
|
50
|
-
'selector-pseudo-class-parentheses-space-inside': 'never',
|
|
51
|
-
'media-feature-colon-space-after': 'always',
|
|
52
|
-
'media-feature-colon-space-before': 'never',
|
|
53
|
-
'media-feature-parentheses-space-inside': 'never',
|
|
54
|
-
'at-rule-semicolon-space-before': 'never',
|
|
55
43
|
'stylelint-core-vars/use-vars': true,
|
|
56
44
|
'stylelint-core-vars/use-mixins': true,
|
|
57
45
|
'stylelint-core-vars/use-one-of-vars': [true, { severity: 'warning' }],
|
package/tsconfig.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Basic Options */
|
|
4
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
5
|
+
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
|
6
|
+
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
|
|
7
|
+
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
8
|
+
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
9
|
+
// "checkJs": true, /* Report errors in .js files. */
|
|
10
|
+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
11
|
+
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
12
|
+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
13
|
+
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
14
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
15
|
+
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
16
|
+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
17
|
+
// "composite": true, /* Enable project compilation */
|
|
18
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
19
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
|
20
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
21
|
+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
22
|
+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
23
|
+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
/* Strict Type-Checking Options */
|
|
26
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
27
|
+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
28
|
+
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
29
|
+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
30
|
+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
31
|
+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
32
|
+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
33
|
+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
/* Additional Checks */
|
|
36
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
37
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
38
|
+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
39
|
+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
/* Module Resolution Options */
|
|
42
|
+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
43
|
+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
44
|
+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
45
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
46
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
47
|
+
// "types": [], /* Type declaration files to be included in compilation. */
|
|
48
|
+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
49
|
+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
|
50
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
51
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
/* Source Map Options */
|
|
54
|
+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
55
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
56
|
+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
57
|
+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
/* Experimental Options */
|
|
60
|
+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
61
|
+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
/* Advanced Options */
|
|
64
|
+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
65
|
+
},
|
|
66
|
+
"include": ["**/*"]
|
|
67
67
|
}
|
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node_modules
|
package/commitlint.config.js
DELETED