arui-presets-lint 5.9.0 → 6.0.1

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 CHANGED
@@ -1,2 +1 @@
1
1
  .idea
2
- .eslintrc.js
package/.yarnrc ADDED
@@ -0,0 +1 @@
1
+ save-prefix ""
package/CHANGELOG.md CHANGED
@@ -1,3 +1,52 @@
1
+ ## 6.0.1 (2022-07-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **eslint:** fix node12 support 4d52210
7
+
8
+ # 6.0.0 (2022-07-25)
9
+
10
+
11
+ ### Features
12
+
13
+ * add .yarnrc aac625f
14
+ * bump semantic-release, change repository url e98a7bc
15
+ * update deps a90bac2
16
+ * update lint-staged and husky 1fe7d74
17
+ * **build:** remove github from release config 5c361e4
18
+ * **build:** remove repo from release config c8d28ca
19
+ * **commitlint:** increase body-max-line-length 006ca95
20
+ * **commitlint:** update commitlint libs d7bfec1
21
+ * **eslint:** forbid unnecessary template literals for best prettier compatibility eee9f53
22
+ * **eslint:** remove harmful eslint rules after testing 561115a
23
+ * **gitignore:** add .DS_Store to .gitignore 272ae54
24
+ * **package.json:** remove repo link from package.json 64b8068
25
+ * **stylelint:** update stylelint, remove stylelint-prettier a61f26f
26
+
27
+
28
+ * feat(eslint)!: update eslint and plugins, add eslint-config-prettier, remove prettier-eslint 0787329
29
+
30
+
31
+ ### BREAKING CHANGES
32
+
33
+ * dropping eslint <8 support, remove prettier-eslint
34
+
35
+ # [5.10.0](https://github.com/alfa-laboratory/arui-presets-lint/compare/v5.9.0...v5.10.0) (2021-11-01)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * delete extra comment ([fec77cc](https://github.com/alfa-laboratory/arui-presets-lint/commit/fec77ccd5bb41cc3641729ea5fead768d88f141c))
41
+ * remarks from pr ([fa6f23f](https://github.com/alfa-laboratory/arui-presets-lint/commit/fa6f23f0ba86d12c3b24c8e65d8c8e872d234dad))
42
+ * return old husky ([95b8201](https://github.com/alfa-laboratory/arui-presets-lint/commit/95b82016adbba11e75585b27b4e1966beb77f44c))
43
+ * update yarnlock ([d8885f7](https://github.com/alfa-laboratory/arui-presets-lint/commit/d8885f755e10ece1c2c77e513a6b34e393feb81f))
44
+
45
+
46
+ ### Features
47
+
48
+ * up libs ([08d4e78](https://github.com/alfa-laboratory/arui-presets-lint/commit/08d4e78024ad8b99b04d9e6e7848dd5d3056b7ad))
49
+
1
50
  # [5.9.0](https://github.com/alfa-laboratory/arui-presets-lint/compare/v5.8.0...v5.9.0) (2021-09-03)
2
51
 
3
52
 
@@ -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
+ 3. Добавить текущие зависимости [README.md](README.md)(##Установка)
11
+
12
+ 4. Заменить вызовы prettier-eslint на prettier:
13
+ - в lint-staged [README.md](README.md)(## Конфигурация `husky` и `lint-staged`)
14
+ - в скриптах package.json [README.md](README.md)(## Конфигурация скриптов для запуска линтеров и форматтера в `package.json`)
15
+
16
+ 5. (Опционально) Поменять подключаемый конфиг [README.md](README.md)(## Конфигурация всех линтеров через `package.json`). Что изменилось: в `eslintConfig.extends` больше не нужно писать `/index.js` в конце, а `commitlint.extends` теперь может быть строкой, а не массивом.
17
+
18
+ 6. Выполнить команду `yarn format` и поправить возникающие ошибки (предупреждения в моменте править не обязательно, если не включен --max-warnings=0).
19
+
20
+ 7. Сообщить остальным людям которые работают с проектом, что нужно доустановить зависимости (`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
- Набор конфигурационных файлов для валидации проектов, основанных на [arui-feather](https://github.com/alfa-laboratory/arui-feather).
13
+ Набор общих конфигурационных файлов для валидации react/node/typescript-проектов.
16
14
 
17
15
  [Как я могу улучшить стандарты?](./.github/CONTRIBUTING.md)
18
16
 
19
- ## Установка
20
- Для установки всех зависимостей проекта рекомендуется использовать [install-peerdeps](https://github.com/nathanhleung/install-peerdeps)
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
- npx install-peerdeps --dev arui-presets-lint
24
+ yarn --immutable
25
+ yarn semantic-release --no-ci
24
26
  ```
25
27
 
26
- Если вы используете yarn на данный момент у вас могут возникнуть проблемы при использовании `install-peerdeps`.
27
- См. этот [issue](https://github.com/nathanhleung/install-peerdeps/issues/70). Временным решением может служить использование
28
- версии `1.11.0`.
28
+ ## Установка
29
+ Для установки всех зависимостей проекта рекомендуется использовать [install-peerdeps](https://github.com/nathanhleung/install-peerdeps)
29
30
 
30
- ```
31
- npx install-peerdeps@1.11.0 --dev arui-presets-lint
31
+ ```sh
32
+ npx install-peerdeps --dev arui-presets-lint
32
33
  ```
33
34
 
34
35
  Так же вы можете поставить все необходимые peerDependencies вручную. Для этого узнайте требуемые версии
35
36
  с помощью команды
36
37
 
37
- ```
38
- npm info "arui-presets-lint@latest" peerDependencies
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/index.js"
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": ["./node_modules/arui-presets-lint/commitlint"]
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
- "format": "prettier-eslint --write $INIT_CWD/{config,src}/**/*.{ts,tsx,js,jsx,css}"
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
- их с помощью `.eslintignore`
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
- "format": "prettier-eslint --write $INIT_CWD/{config,src}/**/*.{ts,tsx,js,jsx,css}"
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
- "prettier": "arui-presets-lint/prettier",
123
- "eslintConfig": {
124
- "extends": "./node_modules/arui-presets-lint/eslint/index.js"
125
- },
126
- "stylelint": {
127
- "extends": "arui-presets-lint/stylelint"
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
- ## Настройка для VS Code:
136
-
137
- https://github.com/prettier/prettier-vscode
138
-
139
- ## Настройка для WebStorm:
140
-
141
- https://prettier.io/docs/en/webstorm.html#using-prettier-with-eslint
142
- Вместо `$ProjectFileDir$/node_modules/.bin/prettier` указывать `$ProjectFileDir$/node_modules/arui-presets-lint/node_modules/.bin/prettier-eslint`
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) 2021 Alfa-Bank
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
@@ -1,6 +1,7 @@
1
1
  module.exports = {
2
- extends: ['@commitlint/config-conventional'],
2
+ extends: '@commitlint/config-conventional',
3
3
  rules: {
4
4
  'scope-empty': [2, 'never'],
5
+ 'body-max-line-length': [2, 'always', 200],
5
6
  },
6
7
  };
package/eslint/index.js CHANGED
@@ -1,6 +1,12 @@
1
1
  module.exports = {
2
2
  parser: '@typescript-eslint/parser',
3
- extends: ['airbnb-typescript', 'airbnb/hooks', 'plugin:@typescript-eslint/recommended'],
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,
@@ -22,6 +28,7 @@ module.exports = {
22
28
  'simple-import-sort',
23
29
  'dirnames',
24
30
  'unicorn',
31
+ 'jsx-a11y',
25
32
  ],
26
33
  settings: {
27
34
  'import/resolver': {
@@ -29,44 +36,26 @@ module.exports = {
29
36
  extensions: ['.ts', '.tsx', '.js', '.jsx'],
30
37
  },
31
38
  },
39
+ react: {
40
+ version: 'detect',
41
+ },
32
42
  },
33
43
  rules: {
34
- quotes: ['warn', 'single', { avoidEscape: true }],
35
- 'comma-dangle': ['warn', 'always-multiline'],
36
- 'comma-spacing': ['warn', { before: false, after: true }],
37
- 'comma-style': ['warn', 'last'],
38
- 'computed-property-spacing': ['warn', 'never'],
39
- 'func-call-spacing': ['warn', 'never'],
40
- indent: ['warn', 4, { SwitchCase: 1 }],
41
- 'key-spacing': ['warn'],
42
- 'no-trailing-spaces': ['warn'],
43
- 'no-whitespace-before-property': ['warn'],
44
+ quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
44
45
  'padding-line-between-statements': [
45
46
  'warn',
46
47
  { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
47
48
  { blankLine: 'always', prev: '*', next: 'return' },
48
49
  { blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
49
50
  ],
50
- 'quote-props': ['warn', 'as-needed'],
51
- semi: ['warn'],
52
- 'semi-spacing': ['warn'],
53
- 'semi-style': ['warn'],
54
- 'space-before-blocks': ['warn'],
55
- 'space-in-parens': ['warn'],
56
- 'space-infix-ops': ['warn'],
57
- 'space-unary-ops': ['warn'],
58
- 'switch-colon-spacing': ['warn'],
59
51
  'no-shadow': 'off',
60
- // This rules conflicts with prettier formatter
61
- 'operator-linebreak': 'off',
62
- 'implicit-arrow-linebreak': 'off',
63
- 'max-len': 'off',
64
52
 
65
53
  // Override default airbnb rules
66
54
  'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
67
55
  'no-negated-condition': 'warn',
68
56
  'default-case': 'off',
69
57
  'no-use-before-define': 'off',
58
+ 'prefer-regex-literals': 'off',
70
59
 
71
60
  // code smell detection
72
61
  complexity: ['warn', 20],
@@ -96,9 +85,6 @@ module.exports = {
96
85
  ],
97
86
 
98
87
  // React
99
- 'react/jsx-indent': ['warn', 4],
100
- 'react/jsx-indent-props': ['warn', 4],
101
- 'react/jsx-curly-spacing': ['warn', { when: 'always', children: true }],
102
88
  'react/jsx-fragments': ['warn', 'element'],
103
89
  'react/static-property-placement': ['error', 'static public field'],
104
90
  'react/state-in-constructor': ['error', 'never'],
@@ -111,6 +97,7 @@ module.exports = {
111
97
  'react/destructuring-assignment': 'off',
112
98
  'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
113
99
  'react/jsx-one-expression-per-line': 'off',
100
+ 'react/function-component-definition': 'off',
114
101
 
115
102
  // A11Y
116
103
  'jsx-a11y/anchor-is-valid': ['warn', { aspects: ['invalidHref'] }],
@@ -120,22 +107,12 @@ module.exports = {
120
107
  ],
121
108
 
122
109
  // typescript
123
- '@typescript-eslint/indent': [
124
- 'warn',
125
- 4,
126
- {
127
- SwitchCase: 1,
128
- ignoredNodes: ['TSTypeParameterInstantiation'],
129
- },
130
- ],
131
110
  '@typescript-eslint/explicit-module-boundary-types': 'off',
132
111
  '@typescript-eslint/explicit-function-return-type': 'off',
133
112
  '@typescript-eslint/array-type': [
134
113
  'error',
135
114
  { default: 'array-simple', readonly: 'array-simple' },
136
115
  ],
137
- '@typescript-eslint/type-annotation-spacing': 'error',
138
- '@typescript-eslint/member-delimiter-style': 'error',
139
116
  '@typescript-eslint/consistent-type-assertions': 'error',
140
117
  '@typescript-eslint/no-array-constructor': 'error',
141
118
  '@typescript-eslint/no-empty-interface': 'error',
@@ -145,6 +122,7 @@ module.exports = {
145
122
  'error',
146
123
  { functions: false, classes: true, variables: true },
147
124
  ],
125
+ '@typescript-eslint/default-param-last': 'off',
148
126
 
149
127
  // Imports, file extensions
150
128
  'import/no-extraneous-dependencies': [
@@ -168,7 +146,7 @@ module.exports = {
168
146
  case: 'kebabCase',
169
147
  },
170
148
  ],
171
- 'simple-import-sort/sort': [
149
+ 'simple-import-sort/imports': [
172
150
  'warn',
173
151
  {
174
152
  groups: [
@@ -192,6 +170,7 @@ module.exports = {
192
170
  ],
193
171
  },
194
172
  ],
173
+ 'import/no-import-module-exports': 'off',
195
174
  },
196
175
  overrides: [
197
176
  {
package/package.json CHANGED
@@ -1,92 +1,89 @@
1
1
  {
2
2
  "name": "arui-presets-lint",
3
- "version": "5.9.0",
3
+ "version": "6.0.1",
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.3.0",
9
- "@commitlint/cli": "^9.1.2",
10
- "@commitlint/config-conventional": "^9.1.2",
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
- "babel-eslint": "^10.1.0",
13
- "case-sensitive-paths-webpack-plugin": "2.3.0",
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": "^4.15.2",
22
- "@typescript-eslint/parser": "^4.15.2",
23
- "eslint": "^7.7.0",
24
- "eslint-config-airbnb": "^18.2.0",
25
- "eslint-config-airbnb-typescript": "^9.0.0",
26
- "eslint-import-resolver-typescript": "^2.2.1",
27
- "eslint-plugin-cypress": "2.11.1",
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.1.5",
23
+ "eslint-plugin-cypress": "^2.12.1",
28
24
  "eslint-plugin-dirnames": "^1.0.3",
29
- "eslint-plugin-import": "^2.22.0",
30
- "eslint-plugin-jsx-a11y": "^6.3.1",
31
- "eslint-plugin-prettier": "^3.1.4",
32
- "eslint-plugin-react": "^7.20.6",
33
- "eslint-plugin-react-hooks": "^4.1.0",
34
- "eslint-plugin-simple-import-sort": "^5.0.3",
35
- "eslint-plugin-unicorn": "^18.0.1",
36
- "husky": "^4.2.5",
37
- "lint-staged": "^10.2.13",
38
- "prettier": "^2.1.1",
39
- "prettier-eslint": "^11.0.0",
40
- "prettier-eslint-cli": "^5.0.0",
41
- "stylelint": "^13.6.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": "^42.0.0",
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.0",
47
- "@semantic-release/github": "7.0.0",
48
- "@semantic-release/npm": "7.0.5",
49
- "@semantic-release/release-notes-generator": "9.0.1",
50
- "@typescript-eslint/eslint-plugin": "^4.15.2",
51
- "@typescript-eslint/parser": "4.15.2",
52
- "eslint": "7.7.0",
53
- "eslint-config-airbnb": "18.2.0",
54
- "eslint-config-airbnb-typescript": "^9.0.0",
55
- "eslint-import-resolver-typescript": "2.2.1",
56
- "eslint-plugin-cypress": "2.11.1",
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.1.5",
52
+ "eslint-plugin-cypress": "2.12.1",
57
53
  "eslint-plugin-dirnames": "1.0.3",
58
- "eslint-plugin-import": "^2.22.0",
59
- "eslint-plugin-jsx-a11y": "^6.3.1",
60
- "eslint-plugin-prettier": "3.1.4",
61
- "eslint-plugin-react": "^7.20.6",
62
- "eslint-plugin-react-hooks": "^4.1.0",
63
- "eslint-plugin-simple-import-sort": "5.0.3",
64
- "eslint-plugin-unicorn": "18.0.1",
65
- "husky": "4.2.5",
66
- "lint-staged": "10.2.13",
67
- "prettier": "2.1.1",
68
- "prettier-eslint": "11.0.0",
69
- "prettier-eslint-cli": "5.0.0",
70
- "semantic-release": "17.1.1",
71
- "stylelint": "13.6.1",
72
- "typescript": "4.1.5"
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": "42.0.0",
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",
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
- "format": "prettier-eslint --write $INIT_CWD/{eslint,stylelint,test,commitlint}/**/*.{ts,tsx,js,jsx,css}"
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,css}": [
85
- "prettier-eslint --write",
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-eslint --write",
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.js"
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
  };
@@ -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
- "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'). */
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
- /* 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. */
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
- /* 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. */
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
- /* 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. */
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
- /* 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. */
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
- /* Experimental Options */
60
- // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
61
- // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
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
- /* Advanced Options */
64
- "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
65
- },
66
- "include": ["**/*"]
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
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ['./commitlint'],
3
- };