@hyperupcall/eslint-config 1.3.0 → 1.3.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/README.md +3 -5
- package/package.json +4 -3
- package/output/index.cjs +0 -103
- package/output/index.d.ts +0 -2
- package/output/index.mjs +0 -101
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperupcall/eslint-config",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Edwin's ESLint configuration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"eslint-plugin-mdx": ">=3.0.0",
|
|
34
34
|
"eslint-plugin-n": ">=17.0.0",
|
|
35
35
|
"eslint-plugin-no-unsanitized": ">=4.0.0",
|
|
36
|
-
"eslint-plugin-perfectionist": ">=
|
|
36
|
+
"eslint-plugin-perfectionist": ">=3.0.0",
|
|
37
37
|
"eslint-plugin-promise": ">=7.0.0",
|
|
38
38
|
"eslint-plugin-regexp": ">=2.0.0",
|
|
39
39
|
"eslint-plugin-security": ">=3.0.0",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@hyperupcall/markdownlint-config": "^0.3.2",
|
|
45
45
|
"@hyperupcall/prettier-config": "^0.9.1",
|
|
46
46
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
47
|
+
"@types/node": "^22.15.17",
|
|
47
48
|
"markdownlint": "^0.37.4",
|
|
48
49
|
"prettier": "^3.5.3",
|
|
49
50
|
"prettier-plugin-pkg": "^0.18.1",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"extends": "./node_modules/@hyperupcall/markdownlint-config/.markdownlint.json"
|
|
58
59
|
},
|
|
59
60
|
"private": false,
|
|
60
|
-
"prettier": "@hyperupcall/
|
|
61
|
+
"prettier": "@hyperupcall/prettier-config",
|
|
61
62
|
"scripts": {
|
|
62
63
|
"build": "rm -rf ./output && rollup --config ./rollup.config.js && tsc --project ./tsconfig.json",
|
|
63
64
|
"format": "prettier --check .",
|
package/output/index.cjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('globals');
|
|
4
|
-
var config = require('eslint/config');
|
|
5
|
-
var langJs = require('@eslint/js');
|
|
6
|
-
require('@eslint/markdown');
|
|
7
|
-
require('eslint-plugin-mdx');
|
|
8
|
-
require('eslint-plugin-promise');
|
|
9
|
-
require('eslint-plugin-n');
|
|
10
|
-
require('eslint-plugin-security');
|
|
11
|
-
require('@eslint-community/eslint-plugin-eslint-comments/configs');
|
|
12
|
-
require('eslint-plugin-unicorn');
|
|
13
|
-
require('eslint-plugin-regexp');
|
|
14
|
-
require('eslint-plugin-no-unsanitized');
|
|
15
|
-
require('eslint-plugin-perfectionist');
|
|
16
|
-
require('eslint-config-prettier');
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @import { RuleEntry } from '@eslint/config-helpers'
|
|
20
|
-
*/
|
|
21
|
-
// TODO: import-x
|
|
22
|
-
|
|
23
|
-
// const config = {
|
|
24
|
-
// "extends": [
|
|
25
|
-
// "plugin:import/recommended",
|
|
26
|
-
// "plugin:mdx/recommended",
|
|
27
|
-
// ],
|
|
28
|
-
// "env": {
|
|
29
|
-
// "shared-node-browser": true,
|
|
30
|
-
// "es2022": true
|
|
31
|
-
// },
|
|
32
|
-
// "parserOptions": {
|
|
33
|
-
// "ecmaVersion": 2022,
|
|
34
|
-
// "sourceType": "module"
|
|
35
|
-
// },
|
|
36
|
-
// "overrides": [
|
|
37
|
-
// {
|
|
38
|
-
// "files": ["*.cjs"],
|
|
39
|
-
// "env": {
|
|
40
|
-
// "commonjs": true
|
|
41
|
-
// },
|
|
42
|
-
// "parserOptions": {
|
|
43
|
-
// "sourceType": "script"
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
// ]
|
|
47
|
-
// }
|
|
48
|
-
|
|
49
|
-
// editing
|
|
50
|
-
// commit
|
|
51
|
-
// release
|
|
52
|
-
/** @returns {RuleEntry} */
|
|
53
|
-
function modeSwitch(/** @type {Record<'edit' | 'commit' | 'release', unknown | undefined>} */ toggles) {
|
|
54
|
-
const possibleModes = ['edit', 'commit', 'release'];
|
|
55
|
-
const currentMode = 'edit';
|
|
56
|
-
if (!possibleModes.includes(currentMode)) {
|
|
57
|
-
throw new Error(`Expected the current mode to be ${new Intl.ListFormat().format(possibleModes).map((/** @type {string} */ item) => `"${item}"`)}. Found "${currentMode}"`)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// if (currentMode === 'edit' && toggles.edit)
|
|
62
|
-
|
|
63
|
-
return toggles[currentMode]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var index = config.defineConfig([
|
|
68
|
-
langJs.configs.recommended,
|
|
69
|
-
{
|
|
70
|
-
rules: {
|
|
71
|
-
'array-callback-return': modeSwitch({
|
|
72
|
-
edit: ['off'],
|
|
73
|
-
commit: ['error'],
|
|
74
|
-
release: ['error'],
|
|
75
|
-
}),
|
|
76
|
-
'constructor-super': modeSwitch({
|
|
77
|
-
edit: ['warn'],
|
|
78
|
-
commit: ['error'],
|
|
79
|
-
release: ['error']
|
|
80
|
-
}),
|
|
81
|
-
'for-direction': ['error'],
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
// langJs.meta.name.
|
|
85
|
-
// ...langMarkdown.configs.recommended,
|
|
86
|
-
// {
|
|
87
|
-
// ...langMdx.flat,
|
|
88
|
-
// processor: langMdx.createRemarkProcessor({
|
|
89
|
-
// lintCodeBlocks: true,
|
|
90
|
-
// }),
|
|
91
|
-
// },
|
|
92
|
-
// pluginPromise.configs['flat/recommended'],
|
|
93
|
-
// pluginNode.configs["flat/recommended-script"],
|
|
94
|
-
// pluginSecurity.configs.recommended,
|
|
95
|
-
// pluginComments.recomended,
|
|
96
|
-
// pluginUnicorn.configs['flat/recommended'],
|
|
97
|
-
// pluginRegexp.configs["flat/recommended"],
|
|
98
|
-
// pluginNoUnsanitized.configs.recommended,
|
|
99
|
-
// pluginPerfectionist.configs['recommended-natural'],
|
|
100
|
-
// configPrettier
|
|
101
|
-
]);
|
|
102
|
-
|
|
103
|
-
module.exports = index;
|
package/output/index.d.ts
DELETED
package/output/index.mjs
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import 'globals';
|
|
2
|
-
import { defineConfig } from 'eslint/config';
|
|
3
|
-
import langJs from '@eslint/js';
|
|
4
|
-
import '@eslint/markdown';
|
|
5
|
-
import 'eslint-plugin-mdx';
|
|
6
|
-
import 'eslint-plugin-promise';
|
|
7
|
-
import 'eslint-plugin-n';
|
|
8
|
-
import 'eslint-plugin-security';
|
|
9
|
-
import '@eslint-community/eslint-plugin-eslint-comments/configs';
|
|
10
|
-
import 'eslint-plugin-unicorn';
|
|
11
|
-
import 'eslint-plugin-regexp';
|
|
12
|
-
import 'eslint-plugin-no-unsanitized';
|
|
13
|
-
import 'eslint-plugin-perfectionist';
|
|
14
|
-
import 'eslint-config-prettier';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @import { RuleEntry } from '@eslint/config-helpers'
|
|
18
|
-
*/
|
|
19
|
-
// TODO: import-x
|
|
20
|
-
|
|
21
|
-
// const config = {
|
|
22
|
-
// "extends": [
|
|
23
|
-
// "plugin:import/recommended",
|
|
24
|
-
// "plugin:mdx/recommended",
|
|
25
|
-
// ],
|
|
26
|
-
// "env": {
|
|
27
|
-
// "shared-node-browser": true,
|
|
28
|
-
// "es2022": true
|
|
29
|
-
// },
|
|
30
|
-
// "parserOptions": {
|
|
31
|
-
// "ecmaVersion": 2022,
|
|
32
|
-
// "sourceType": "module"
|
|
33
|
-
// },
|
|
34
|
-
// "overrides": [
|
|
35
|
-
// {
|
|
36
|
-
// "files": ["*.cjs"],
|
|
37
|
-
// "env": {
|
|
38
|
-
// "commonjs": true
|
|
39
|
-
// },
|
|
40
|
-
// "parserOptions": {
|
|
41
|
-
// "sourceType": "script"
|
|
42
|
-
// }
|
|
43
|
-
// }
|
|
44
|
-
// ]
|
|
45
|
-
// }
|
|
46
|
-
|
|
47
|
-
// editing
|
|
48
|
-
// commit
|
|
49
|
-
// release
|
|
50
|
-
/** @returns {RuleEntry} */
|
|
51
|
-
function modeSwitch(/** @type {Record<'edit' | 'commit' | 'release', unknown | undefined>} */ toggles) {
|
|
52
|
-
const possibleModes = ['edit', 'commit', 'release'];
|
|
53
|
-
const currentMode = 'edit';
|
|
54
|
-
if (!possibleModes.includes(currentMode)) {
|
|
55
|
-
throw new Error(`Expected the current mode to be ${new Intl.ListFormat().format(possibleModes).map((/** @type {string} */ item) => `"${item}"`)}. Found "${currentMode}"`)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// if (currentMode === 'edit' && toggles.edit)
|
|
60
|
-
|
|
61
|
-
return toggles[currentMode]
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var index = defineConfig([
|
|
66
|
-
langJs.configs.recommended,
|
|
67
|
-
{
|
|
68
|
-
rules: {
|
|
69
|
-
'array-callback-return': modeSwitch({
|
|
70
|
-
edit: ['off'],
|
|
71
|
-
commit: ['error'],
|
|
72
|
-
release: ['error'],
|
|
73
|
-
}),
|
|
74
|
-
'constructor-super': modeSwitch({
|
|
75
|
-
edit: ['warn'],
|
|
76
|
-
commit: ['error'],
|
|
77
|
-
release: ['error']
|
|
78
|
-
}),
|
|
79
|
-
'for-direction': ['error'],
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
// langJs.meta.name.
|
|
83
|
-
// ...langMarkdown.configs.recommended,
|
|
84
|
-
// {
|
|
85
|
-
// ...langMdx.flat,
|
|
86
|
-
// processor: langMdx.createRemarkProcessor({
|
|
87
|
-
// lintCodeBlocks: true,
|
|
88
|
-
// }),
|
|
89
|
-
// },
|
|
90
|
-
// pluginPromise.configs['flat/recommended'],
|
|
91
|
-
// pluginNode.configs["flat/recommended-script"],
|
|
92
|
-
// pluginSecurity.configs.recommended,
|
|
93
|
-
// pluginComments.recomended,
|
|
94
|
-
// pluginUnicorn.configs['flat/recommended'],
|
|
95
|
-
// pluginRegexp.configs["flat/recommended"],
|
|
96
|
-
// pluginNoUnsanitized.configs.recommended,
|
|
97
|
-
// pluginPerfectionist.configs['recommended-natural'],
|
|
98
|
-
// configPrettier
|
|
99
|
-
]);
|
|
100
|
-
|
|
101
|
-
export { index as default };
|