@w5s/eslint-config 1.0.0-alpha.26 → 1.0.0-alpha.29

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Julien Polo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/es.js CHANGED
@@ -12,7 +12,7 @@ module.exports = {
12
12
  parser: '@babel/eslint-parser',
13
13
  parserOptions: {
14
14
  babelOptions: {
15
- plugins: ['@babel/plugin-syntax-class-properties', '@babel/plugin-syntax-jsx'],
15
+ plugins: [],
16
16
  },
17
17
  ecmaFeatures: {
18
18
  jsx: true,
package/json.js CHANGED
@@ -1,9 +1,163 @@
1
+ // https://github.com/keithamus/sort-package-json/blob/master/defaultRules.md
1
2
  module.exports = {
2
- ignorePatterns: ['**/tsconfig.json', '.vscode/**'], // To remove warning
3
- plugins: ['json-format'],
4
- settings: {
5
- 'json/ignore-files': ['**/package-lock.json'],
6
- 'json/json-with-comments-files': ['**/tsconfig.json', '.vscode/**'],
7
- 'json/sort-package-json': 'standard',
3
+ extends: ['plugin:jsonc/recommended-with-jsonc', 'plugin:jsonc/prettier'],
4
+ overrides: [
5
+ {
6
+ files: ['package.json'],
7
+ parser: 'jsonc-eslint-parser',
8
+ rules: {
9
+ 'jsonc/sort-keys': [
10
+ 'error',
11
+ {
12
+ order: [
13
+ '$schema',
14
+ 'name',
15
+ 'displayName',
16
+ 'version',
17
+ 'private',
18
+ 'description',
19
+ 'categories',
20
+ 'keywords',
21
+ 'homepage',
22
+ 'bugs',
23
+ 'repository',
24
+ 'funding',
25
+ 'license',
26
+ 'qna',
27
+ 'author',
28
+ 'maintainers', // Key order (per item): name, email, url
29
+ 'contributors', // Key order (per item): name, email, url
30
+ 'publisher',
31
+ 'sideEffects',
32
+ 'type',
33
+ 'imports',
34
+ 'exports',
35
+ 'main',
36
+ 'svelte',
37
+ 'umd:main',
38
+ 'jsdelivr',
39
+ 'unpkg',
40
+ 'module',
41
+ 'source',
42
+ 'jsnext:main',
43
+ 'browser',
44
+ 'react-native',
45
+ 'types',
46
+ 'typesVersions',
47
+ 'typings',
48
+ 'style',
49
+ 'example',
50
+ 'examplestyle',
51
+ 'assets',
52
+ 'bin',
53
+ 'man',
54
+ 'directories', // Key order: lib, bin, man, doc, example, test
55
+ 'files', // Unique items
56
+ 'workspaces',
57
+ 'binary', // Key order: module_name, module_path, remote_path, package_name, host
58
+ 'scripts', // Script sort
59
+ 'betterScripts', // Script sort
60
+ 'contributes',
61
+ 'activationEvents', // Unique items
62
+ 'husky', // Sorts the hooks field using git hook sort
63
+ 'simple-git-hooks', // Key sort using git hook sort
64
+ 'pre-commit',
65
+ 'commitlint',
66
+ 'lint-staged',
67
+ 'config',
68
+ 'nodemonConfig',
69
+ 'browserify',
70
+ 'babel',
71
+ 'browserslist',
72
+ 'xo',
73
+ 'prettier', // Prettier sort
74
+ 'eslintConfig', // ESLint sort
75
+ 'eslintIgnore',
76
+ 'npmpackagejsonlint', // Key sort (also recognizes: npmPackageJsonLintConfig, npmpkgjsonlint)
77
+ 'release',
78
+ 'remarkConfig',
79
+ 'stylelint',
80
+ 'ava',
81
+ 'jest',
82
+ 'mocha',
83
+ 'nyc',
84
+ 'tap',
85
+ 'resolutions',
86
+ 'dependencies',
87
+ 'devDependencies',
88
+ 'dependenciesMeta', // Key sort (deep)
89
+ 'peerDependencies',
90
+ 'peerDependenciesMeta', // Key sort (deep)
91
+ 'optionalDependencies',
92
+ 'bundledDependencies',
93
+ 'bundleDependencies',
94
+ 'extensionPack',
95
+ 'extensionDependencies',
96
+ 'flat',
97
+ 'packageManager',
98
+ 'engines',
99
+ 'engineStrict',
100
+ 'volta', // Key order: node, npm, yarn
101
+ 'languageName',
102
+ 'os',
103
+ 'cpu',
104
+ 'preferGlobal',
105
+ 'publishConfig',
106
+ 'icon',
107
+ 'badges', // Key order (per item): description, url, href
108
+ 'galleryBanner',
109
+ 'preview',
110
+ 'markdown',
111
+ ],
112
+ pathPattern: '^$',
113
+ },
114
+ {
115
+ order: ['url', 'email'],
116
+ pathPattern: `^bugs$`,
117
+ },
118
+ ...['repository', 'funding', 'license', 'author'].map((key) => ({
119
+ order: ['type', 'name', 'email', 'url'],
120
+ pathPattern: `^${key}$`,
121
+ })),
122
+ ...[
123
+ 'bin',
124
+ 'contributes',
125
+ 'commitlint',
126
+ 'config',
127
+ 'nodemonConfig',
128
+ 'browserify',
129
+ 'babel',
130
+ 'xo',
131
+ 'release',
132
+ 'remarkConfig',
133
+ 'ava',
134
+ 'jest',
135
+ 'mocha',
136
+ 'nyc',
137
+ 'tap',
138
+ 'resolutions',
139
+ 'engines',
140
+ 'engineStrict',
141
+ 'preferGlobal',
142
+ 'publishConfig',
143
+ 'galleryBanner',
144
+ ].map((key) => ({
145
+ order: { type: 'asc' },
146
+ pathPattern: `^${key}$`,
147
+ })),
148
+ {
149
+ order: { type: 'asc' },
150
+ pathPattern: '^(?:dev|peer|optional|bundled|extension)?[Dd]ependencies$',
151
+ },
152
+ {
153
+ order: ['types', 'require', 'import'],
154
+ pathPattern: '^exports.*$',
155
+ },
156
+ ],
157
+ },
158
+ },
159
+ ],
160
+ rules: {
161
+ // 'jsonc/sort-keys': 'error',
8
162
  },
9
163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "1.0.0-alpha.26",
3
+ "version": "1.0.0-alpha.29",
4
4
  "description": "ESLint configuration presets",
5
5
  "keywords": [
6
6
  "eslint",
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "Julien Polo <julien.polo@gmail.com>",
21
+ "type": "commonjs",
21
22
  "main": "index.js",
22
23
  "files": [
23
24
  "*.js",
@@ -45,9 +46,9 @@
45
46
  "__tests__"
46
47
  ],
47
48
  "dependencies": {
48
- "@babel/eslint-parser": "^7.0.0",
49
- "@babel/plugin-syntax-class-properties": "^7.0.0",
50
- "@babel/plugin-syntax-jsx": "^7.0.0",
49
+ "@babel/core": "*",
50
+ "@babel/eslint-parser": "*",
51
+ "@rushstack/eslint-patch": "^1.1.0",
51
52
  "@typescript-eslint/eslint-plugin": "^5.0.0",
52
53
  "@typescript-eslint/parser": "^5.0.0",
53
54
  "eslint-config-airbnb-base": "^15.0.0",
@@ -56,7 +57,7 @@
56
57
  "eslint-plugin-import": "^2.25.0",
57
58
  "eslint-plugin-jest": "^26.0.0",
58
59
  "eslint-plugin-jsdoc": "^39.0.0",
59
- "eslint-plugin-json-format": "^2.0.1",
60
+ "eslint-plugin-jsonc": "^2.4.0",
60
61
  "eslint-plugin-prettier": "^4.0.0",
61
62
  "eslint-plugin-promise": "^6.0.0",
62
63
  "eslint-plugin-react": "^7.28.0",
@@ -65,19 +66,19 @@
65
66
  },
66
67
  "devDependencies": {
67
68
  "@babel/eslint-parser": "7.18.9",
68
- "@types/eslint": "8.4.5",
69
- "@types/eslint-plugin-prettier": "^3.1.0",
69
+ "@types/eslint": "8.4.6",
70
+ "@types/eslint-plugin-prettier": "3.1.0",
70
71
  "@types/prettier": "2.7.0",
71
- "@types/react": "18.0.16",
72
- "@typescript-eslint/parser": "5.32.0",
73
- "eslint": "8.21.0",
72
+ "@types/react": "18.0.17",
73
+ "@typescript-eslint/parser": "5.35.1",
74
+ "eslint": "8.23.0",
74
75
  "eslint-config-prettier": "8.5.0",
75
76
  "eslint-index": "1.5.0",
76
77
  "prettier": "2.7.1",
77
78
  "react": "18.2.0"
78
79
  },
79
80
  "peerDependencies": {
80
- "eslint": "5.x || 6.x || 7.x || 8.x",
81
+ "eslint": "8.x",
81
82
  "prettier": "2.x",
82
83
  "typescript": "4.x"
83
84
  },
@@ -91,5 +92,6 @@
91
92
  },
92
93
  "publishConfig": {
93
94
  "access": "public"
94
- }
95
+ },
96
+ "gitHead": "18cd55f50f759629d9a0feadba44df1b44b4dfb0"
95
97
  }
package/rules/base.js CHANGED
@@ -1,5 +1,9 @@
1
1
  const { concatESConfig, off, error } = require('./_rule.js');
2
2
 
3
+ // Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458)
4
+ // @ts-ignore
5
+ require('@rushstack/eslint-patch/modern-module-resolution.js');
6
+
3
7
  const baseConfig = concatESConfig(
4
8
  // @ts-ignore
5
9
  require('eslint-config-airbnb-base/rules/best-practices'),