@rife/config 0.0.6-beta.5 → 0.0.6-beta.7

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/.prettierrc.js CHANGED
@@ -1,27 +1,27 @@
1
- // https://prettier.io/docs/en/options.html
2
-
3
- /**
4
- * @type {any}
5
- */
6
- module.exports = {
7
- printWidth: 135,
8
- useTabs: false, // 缩进使用空格
9
- tabWidth: 4,
10
- semi: true, // 强制加分号
11
- singleQuote: true, // 强制单引号
12
- quoteProps: 'as-needed',
13
- jsxSingleQuote: false,
14
- trailingComma: 'all',
15
- bracketSameLine: true, // jsx props结束符在新行
16
- arrowParens: 'avoid',
17
- endOfLine: 'lf',
18
- bracketSpacing: true,
19
- overrides: [
20
- {
21
- files: ['*.wxml'],
22
- options: {
23
- parser: 'html',
24
- },
25
- },
26
- ],
27
- }
1
+ // https://prettier.io/docs/en/options.html
2
+
3
+ /**
4
+ * @type {any}
5
+ */
6
+ module.exports = {
7
+ printWidth: 135,
8
+ useTabs: false, // 缩进使用空格
9
+ tabWidth: 4,
10
+ semi: true, // 强制加分号
11
+ singleQuote: true, // 强制单引号
12
+ quoteProps: 'as-needed',
13
+ jsxSingleQuote: false,
14
+ trailingComma: 'all',
15
+ bracketSameLine: true, // jsx props结束符在新行
16
+ arrowParens: 'avoid',
17
+ endOfLine: 'lf',
18
+ bracketSpacing: true,
19
+ overrides: [
20
+ {
21
+ files: ['*.wxml'],
22
+ options: {
23
+ parser: 'html',
24
+ },
25
+ },
26
+ ],
27
+ };
package/eslint.mjs CHANGED
@@ -1,112 +1,114 @@
1
- /**
2
- * rules : https://eslint.org/docs/latest/rules/
3
- * typescript-eslint : https://typescript-eslint.io/getting-started/
4
- * eslint-plugin-import : https://github.com/benmosher/eslint-plugin-import
5
- * eslint-config-prettier : https://github.com/prettier/eslint-config-prettier
6
- * @antfu/eslint-config : https://eslint-config.antfu.me/configs
7
- */
8
- import parser from '@typescript-eslint/parser';
9
- import prettier from 'eslint-config-prettier';
10
- import importPlugin from 'eslint-plugin-import';
11
-
12
- export function eslint() {
13
- return [
14
- {
15
- languageOptions: {
16
- parser,
17
- ecmaVersion: 'latest',
18
- },
19
- plugins: {
20
- import: importPlugin,
21
- },
22
- files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
23
- // ignores: ['*/node_modules/**/*'],
24
- rules: {
25
- 'unicode-bom': ['error', 'never'],
26
- eqeqeq: ['warn', 'always'], // 使用三等号
27
- 'no-console': ['warn', { allow: ['warn', 'error'] }],
28
- 'prefer-const': [
29
- 'error',
30
- {
31
- destructuring: 'any',
32
- ignoreReadBeforeAssign: false,
33
- },
34
- ],
35
- 'no-useless-computed-key': 'error',
36
- 'object-shorthand': 'error',
37
- 'prefer-template': 'error',
38
- 'import/newline-after-import': ['warn'], // import 语句后新增一行
39
- 'import/no-empty-named-blocks': ['warn'], // 不能空导入
40
- 'import/no-duplicates': ['warn', { 'prefer-inline': true }], // 不能重复从一个文件导入
41
- 'import/no-useless-path-segments': [
42
- 'error',
43
- {
44
- noUselessIndex: true,
45
- },
46
- ],
47
- 'import/order': [
48
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
49
- 'warn',
50
- {
51
- groups: ['builtin', 'external', 'internal', ['parent', 'index', 'sibling'], 'object'],
52
- pathGroups: [
53
- {
54
- pattern: '@rife/**',
55
- group: 'external',
56
- position: 'after',
57
- },
58
- {
59
- pattern: '@/**',
60
- group: 'internal',
61
- position: 'after',
62
- },
63
- {
64
- pattern: 'src/**',
65
- group: 'internal',
66
- position: 'after',
67
- },
68
- // https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
69
- {
70
- pattern: '**/*.+(css|sass|less|scss|pcss|styl)',
71
- patternOptions: { dot: true, nocomment: true },
72
- group: 'unknown',
73
- position: 'after',
74
- },
75
- {
76
- pattern: '{.,..}/**/*.+(css|sass|less|scss|pcss|styl)',
77
- patternOptions: { dot: true, nocomment: true },
78
- group: 'unknown',
79
- position: 'after',
80
- },
81
- {
82
- pattern: '**/*.+(svg|png|gif|jpg|jpeg|webp|bmp|ico)',
83
- patternOptions: { dot: true, nocomment: true },
84
- group: 'unknown',
85
- position: 'after',
86
- },
87
- {
88
- pattern: '{.,..}/**/*.+(svg|png|gif|jpg|jpeg|webp|bmp|ico)',
89
- patternOptions: { dot: true, nocomment: true },
90
- group: 'unknown',
91
- position: 'after',
92
- },
93
- ],
94
- pathGroupsExcludedImportTypes: [],
95
- distinctGroup: false,
96
- 'newlines-between': 'always', // import 语句中间新增一行
97
- named: {
98
- // 导入名称按字母排序
99
- enabled: true,
100
- types: 'types-first',
101
- },
102
- alphabetize: {
103
- // 导入名称按字母排序
104
- order: 'asc',
105
- },
106
- },
107
- ],
108
- },
109
- },
110
- prettier,
111
- ];
112
- }
1
+ /**
2
+ * rules : https://eslint.org/docs/latest/rules/
3
+ * typescript-eslint : https://typescript-eslint.io/getting-started/
4
+ * eslint-plugin-import : https://github.com/benmosher/eslint-plugin-import
5
+ * eslint-config-prettier : https://github.com/prettier/eslint-config-prettier
6
+ * @antfu/eslint-config : https://eslint-config.antfu.me/configs
7
+ */
8
+ import parser from '@typescript-eslint/parser';
9
+ import prettier from 'eslint-config-prettier';
10
+ import importPlugin from 'eslint-plugin-import';
11
+
12
+ const ignores = ['*/node_modules/**/*', '*/dist/**/*'];
13
+
14
+ export function eslint() {
15
+ return [
16
+ {
17
+ languageOptions: {
18
+ parser,
19
+ ecmaVersion: 'latest',
20
+ },
21
+ plugins: {
22
+ import: importPlugin,
23
+ },
24
+ files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
25
+ ignores,
26
+ rules: {
27
+ 'unicode-bom': ['error', 'never'],
28
+ eqeqeq: ['warn', 'always'], // 使用三等号
29
+ 'no-console': ['warn', { allow: ['warn', 'error'] }],
30
+ 'prefer-const': [
31
+ 'error',
32
+ {
33
+ destructuring: 'any',
34
+ ignoreReadBeforeAssign: false,
35
+ },
36
+ ],
37
+ 'no-useless-computed-key': 'error',
38
+ 'object-shorthand': 'error',
39
+ 'prefer-template': 'error',
40
+ 'import/newline-after-import': ['warn'], // import 语句后新增一行
41
+ 'import/no-empty-named-blocks': ['warn'], // 不能空导入
42
+ 'import/no-duplicates': ['warn', { 'prefer-inline': true }], // 不能重复从一个文件导入
43
+ 'import/no-useless-path-segments': [
44
+ 'error',
45
+ {
46
+ noUselessIndex: true,
47
+ },
48
+ ],
49
+ 'import/order': [
50
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
51
+ 'warn',
52
+ {
53
+ groups: ['builtin', 'external', 'internal', ['parent', 'index', 'sibling'], 'object'],
54
+ pathGroups: [
55
+ {
56
+ pattern: '@rife/**',
57
+ group: 'external',
58
+ position: 'after',
59
+ },
60
+ {
61
+ pattern: '@/**',
62
+ group: 'internal',
63
+ position: 'after',
64
+ },
65
+ {
66
+ pattern: 'src/**',
67
+ group: 'internal',
68
+ position: 'after',
69
+ },
70
+ // https://github.com/import-js/eslint-plugin-import/issues/1239#issuecomment-598064339
71
+ {
72
+ pattern: '**/*.+(css|sass|less|scss|pcss|styl)',
73
+ patternOptions: { dot: true, nocomment: true },
74
+ group: 'unknown',
75
+ position: 'after',
76
+ },
77
+ {
78
+ pattern: '{.,..}/**/*.+(css|sass|less|scss|pcss|styl)',
79
+ patternOptions: { dot: true, nocomment: true },
80
+ group: 'unknown',
81
+ position: 'after',
82
+ },
83
+ {
84
+ pattern: '**/*.+(svg|png|gif|jpg|jpeg|webp|bmp|ico)',
85
+ patternOptions: { dot: true, nocomment: true },
86
+ group: 'unknown',
87
+ position: 'after',
88
+ },
89
+ {
90
+ pattern: '{.,..}/**/*.+(svg|png|gif|jpg|jpeg|webp|bmp|ico)',
91
+ patternOptions: { dot: true, nocomment: true },
92
+ group: 'unknown',
93
+ position: 'after',
94
+ },
95
+ ],
96
+ pathGroupsExcludedImportTypes: [],
97
+ distinctGroup: false,
98
+ 'newlines-between': 'always', // import 语句中间新增一行
99
+ named: {
100
+ // 导入名称按字母排序
101
+ enabled: true,
102
+ types: 'types-first',
103
+ },
104
+ alphabetize: {
105
+ // 导入名称按字母排序
106
+ order: 'asc',
107
+ },
108
+ },
109
+ ],
110
+ },
111
+ },
112
+ prettier,
113
+ ];
114
+ }
package/package.json CHANGED
@@ -1,22 +1,17 @@
1
1
  {
2
2
  "name": "@rife/config",
3
- "version": "0.0.6-beta.5",
4
- "description": "",
5
- "author": "",
6
- "license": "ISC",
7
- "keywords": [],
8
- "main": "index.js",
3
+ "version": "0.0.6-beta.7",
9
4
  "files": [
10
5
  "tsconfig.json",
11
6
  ".prettierrc.js",
12
7
  "eslint.mjs"
13
8
  ],
14
9
  "dependencies": {
15
- "@typescript-eslint/parser": "^8.20.0",
16
- "eslint": "^9.18.0",
17
- "eslint-config-prettier": "^10.0.1",
10
+ "@typescript-eslint/parser": "^8.34.0",
11
+ "eslint": "^9.28.0",
12
+ "eslint-config-prettier": "^10.1.5",
18
13
  "eslint-plugin-import": "^2.31.0",
19
- "prettier": "^3.4.2"
14
+ "prettier": "^3.5.3"
20
15
  },
21
16
  "rife": {
22
17
  "hostDependencies": {
@@ -24,7 +19,6 @@
24
19
  }
25
20
  },
26
21
  "scripts": {
27
- "lint": "eslint . --fix",
28
22
  "release": "pnpm publish --registry https://registry.npmjs.org --no-git-checks"
29
23
  }
30
24
  }
package/tsconfig.json CHANGED
@@ -1,32 +1,32 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "CommonJS",
5
- "lib": ["ESNext", "DOM"],
6
- "sourceMap": true,
7
- "pretty": true,
8
- "strict": true,
9
- "strictPropertyInitialization": false,
10
- "allowJs": true,
11
- "declaration": true,
12
- "noImplicitAny": true,
13
- "noUnusedLocals": false,
14
- "noUnusedParameters": false,
15
- "noImplicitReturns": true,
16
- "noFallthroughCasesInSwitch": true,
17
- "moduleResolution": "node",
18
- "resolveJsonModule": true,
19
- "downlevelIteration": true,
20
- "experimentalDecorators": true,
21
- "esModuleInterop": true,
22
- "skipLibCheck": true,
23
- "importHelpers": true,
24
- "jsx": "react",
25
- "useUnknownInCatchVariables": false,
26
- "forceConsistentCasingInFileNames": true,
27
- "incremental": true,
28
- "noImplicitThis": true,
29
- "alwaysStrict": true
30
- },
31
- "include": ["./src/**/*"]
32
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "esnext",
5
+ "lib": ["ESNext", "DOM"],
6
+ "sourceMap": true,
7
+ "pretty": true,
8
+ "strict": true,
9
+ "strictPropertyInitialization": false,
10
+ "allowJs": true,
11
+ "declaration": true,
12
+ "noImplicitAny": true,
13
+ "noUnusedLocals": false,
14
+ "noUnusedParameters": false,
15
+ "noImplicitReturns": true,
16
+ "noFallthroughCasesInSwitch": true,
17
+ "moduleResolution": "bundler",
18
+ "resolveJsonModule": true,
19
+ "downlevelIteration": true,
20
+ "experimentalDecorators": true,
21
+ "esModuleInterop": true,
22
+ "skipLibCheck": true,
23
+ "importHelpers": true,
24
+ "jsx": "react",
25
+ "useUnknownInCatchVariables": false,
26
+ "forceConsistentCasingInFileNames": true,
27
+ "incremental": true,
28
+ "noImplicitThis": true,
29
+ "alwaysStrict": true
30
+ },
31
+ "include": ["package.json"]
32
+ }