@alexlit/lint-kit 112.1.2 → 112.3.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/lint-staged.config.js +2 -4
- package/package.json +2 -1
- package/packages/config-eslint/package.json +4 -4
- package/packages/config-hooks/README.md +14 -5
- package/packages/config-hooks/index.js +1 -1
- package/packages/config-hooks/lint-staged.js +74 -42
- package/packages/config-hooks/package.json +1 -1
- package/packages/config-prettier/package.json +3 -3
- package/scripts/release.sh +19 -0
package/lint-staged.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/lint-kit",
|
|
3
|
-
"version": "112.
|
|
3
|
+
"version": "112.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Preset of configuration files and dependencies for linting web applications (designed for Vue.js with TypeScript)",
|
|
6
6
|
"keywords": [
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"lint:npmlint": "time ./scripts/lint.npmlint.sh",
|
|
63
63
|
"lint:stylelint": "time ./scripts/lint.stylelint.sh",
|
|
64
64
|
"prepare": "husky",
|
|
65
|
+
"release": "./scripts/release.sh",
|
|
65
66
|
"semver": "./scripts/semver.sh",
|
|
66
67
|
"up": "./scripts/up.sh"
|
|
67
68
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/config-eslint",
|
|
3
|
-
"version": "79.
|
|
3
|
+
"version": "79.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Eslint config",
|
|
6
6
|
"keywords": [
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@intlify/eslint-plugin-vue-i18n": "^2.0.0",
|
|
39
39
|
"@tanstack/eslint-plugin-query": "^5.28.6",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
41
|
-
"@typescript-eslint/parser": "^7.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
41
|
+
"@typescript-eslint/parser": "^7.5.0",
|
|
42
42
|
"eslint": "^8.57.0",
|
|
43
43
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
44
44
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"eslint-plugin-typescript-sort-keys": "^3.2.0",
|
|
80
80
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
81
81
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
82
|
-
"eslint-plugin-vitest": "^0.4.
|
|
82
|
+
"eslint-plugin-vitest": "^0.4.1",
|
|
83
83
|
"eslint-plugin-vue": "^9.24.0",
|
|
84
84
|
"eslint-plugin-vuejs-accessibility": "^2.2.1",
|
|
85
85
|
"eslint-plugin-wc": "^2.0.4",
|
|
@@ -12,11 +12,20 @@ npm i @alexlit/config-hooks -D
|
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
14
|
// lint-staged.config.js
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
export default
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
import { createLintStagedConfig } from '@alexlit/config-hooks';
|
|
16
|
+
|
|
17
|
+
export default createLintStagedConfig(
|
|
18
|
+
// optional plugins list
|
|
19
|
+
{
|
|
20
|
+
stylelint: false,
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// optional config
|
|
24
|
+
{
|
|
25
|
+
'*.css': [], // disable existing rule
|
|
26
|
+
'*.yaml': ['echo "Hello, .yaml!"'], // custom rule
|
|
27
|
+
},
|
|
28
|
+
);
|
|
20
29
|
```
|
|
21
30
|
|
|
22
31
|
- husky
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// eslint-disable-next-line import/extensions
|
|
2
|
-
export {
|
|
2
|
+
export { createLintStagedConfig } from './lint-staged.js';
|
|
@@ -1,43 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
'
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
'
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Create lint-staged config
|
|
3
|
+
*
|
|
4
|
+
* @param {Record<string, boolean>} plugins Enabled plugins
|
|
5
|
+
* @param {Record<string, any>} config Users config
|
|
6
|
+
*
|
|
7
|
+
* @returns {Record<string, any>} Lint-staged configuration
|
|
8
|
+
*/
|
|
9
|
+
const createLintStagedConfig = (plugins = {}, config = {}) => {
|
|
10
|
+
const pluginsList = {
|
|
11
|
+
eslint: true,
|
|
12
|
+
htmllint: true,
|
|
13
|
+
lockfilelint: true,
|
|
14
|
+
markdownlint: true,
|
|
15
|
+
npmlint: true,
|
|
16
|
+
prettier: true,
|
|
17
|
+
stylelint: true,
|
|
18
|
+
|
|
19
|
+
...plugins,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const eslint = pluginsList.eslint ? 'eslint --fix' : 'true';
|
|
23
|
+
|
|
24
|
+
const htmllint = pluginsList.htmllint ? 'linthtml' : 'true';
|
|
25
|
+
|
|
26
|
+
const lockfilelint = pluginsList.lockfilelint
|
|
27
|
+
? 'lockfile-lint --type npm --path package-lock.json'
|
|
28
|
+
: 'true';
|
|
29
|
+
|
|
30
|
+
const markdownlint = pluginsList.markdownlint ? 'markdownlint --fix' : 'true';
|
|
31
|
+
|
|
32
|
+
const npmlint = pluginsList.npmlint ? 'npmPkgJsonLint' : 'true';
|
|
33
|
+
|
|
34
|
+
const prettier = pluginsList.prettier ? 'prettier --write' : 'true';
|
|
35
|
+
|
|
36
|
+
const stylelint = pluginsList.stylelint ? 'stylelint --fix' : 'true';
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
'*.cjs': [eslint, prettier],
|
|
40
|
+
'*.css': [stylelint, prettier],
|
|
41
|
+
'*.erb': [prettier],
|
|
42
|
+
'*.html': [htmllint, prettier],
|
|
43
|
+
'*.jade': [prettier],
|
|
44
|
+
'*.js': [eslint, prettier],
|
|
45
|
+
'*.json,!package-lock.json': [prettier],
|
|
46
|
+
'*.jsonc': [prettier],
|
|
47
|
+
'*.jsonp': [prettier],
|
|
48
|
+
'*.jsx': [eslint, prettier],
|
|
49
|
+
'*.md': [prettier, markdownlint],
|
|
50
|
+
'*.mjs': [eslint, prettier],
|
|
51
|
+
'*.pcss': [stylelint, prettier],
|
|
52
|
+
'*.php': [prettier],
|
|
53
|
+
'*.postcss': [stylelint, prettier],
|
|
54
|
+
'*.pug': [prettier],
|
|
55
|
+
'*.rb': [prettier],
|
|
56
|
+
'*.sass': [stylelint, prettier],
|
|
57
|
+
'*.scss': [stylelint, prettier],
|
|
58
|
+
'*.sh': [prettier],
|
|
59
|
+
'*.sol': [prettier],
|
|
60
|
+
'*.sql': [prettier],
|
|
61
|
+
'*.svg': [prettier],
|
|
62
|
+
'*.ts': [eslint, prettier],
|
|
63
|
+
'*.tsx': [eslint, prettier],
|
|
64
|
+
'*.vue': [eslint, stylelint, prettier],
|
|
65
|
+
'*.xml': [prettier],
|
|
66
|
+
'*.yaml': [prettier],
|
|
67
|
+
'*.yml': [prettier],
|
|
68
|
+
'package-lock.json': [lockfilelint],
|
|
69
|
+
'package.json': [npmlint],
|
|
70
|
+
|
|
71
|
+
...config,
|
|
72
|
+
};
|
|
43
73
|
};
|
|
74
|
+
|
|
75
|
+
export { createLintStagedConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/config-prettier",
|
|
3
|
-
"version": "18.0
|
|
3
|
+
"version": "18.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "prettier config",
|
|
6
6
|
"keywords": [
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@prettier/plugin-php": "^0.22.2",
|
|
37
37
|
"@prettier/plugin-pug": "^3.0.0",
|
|
38
38
|
"@prettier/plugin-ruby": "^4.0.4",
|
|
39
|
-
"@prettier/plugin-xml": "^3.
|
|
39
|
+
"@prettier/plugin-xml": "^3.4.1",
|
|
40
40
|
"prettier": "^3.2.5",
|
|
41
41
|
"prettier-plugin-jsdoc": "^1.3.0",
|
|
42
|
-
"prettier-plugin-packagejson": "^2.4.
|
|
42
|
+
"prettier-plugin-packagejson": "^2.4.14",
|
|
43
43
|
"prettier-plugin-sh": "^0.14.0",
|
|
44
44
|
"prettier-plugin-solidity": "^1.3.1",
|
|
45
45
|
"prettier-plugin-sort-json": "^4.0.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Релиз пакета (коммит в npm и git)
|
|
2
|
+
|
|
3
|
+
VERSION=${1:-patch} # patch | minor | major
|
|
4
|
+
|
|
5
|
+
DEFAULT='\e[39m'
|
|
6
|
+
GREEN='\e[32m'
|
|
7
|
+
YELLOW='\e[33m'
|
|
8
|
+
|
|
9
|
+
CURRENT_DIR=${PWD##*/}
|
|
10
|
+
|
|
11
|
+
clear
|
|
12
|
+
|
|
13
|
+
echo -e "${YELLOW}Релиз пакета ${GREEN}${CURRENT_DIR}${YELLOW}@${GREEN}${VERSION}${YELLOW}...${DEFAULT}"
|
|
14
|
+
|
|
15
|
+
npm run semver ${VERSION}
|
|
16
|
+
|
|
17
|
+
npm pu
|
|
18
|
+
|
|
19
|
+
git push
|