@pengzhanbo/eslint-config-solid 1.0.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/README.md +22 -0
- package/dist/index.cjs +99 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +59 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @pengzhanbo/eslint-config-solid
|
|
2
|
+
|
|
3
|
+
## Documentation
|
|
4
|
+
|
|
5
|
+
[Document](https://github.com/pengzhanbo/configs/tree/main/docs/eslint.md)
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @pengzhanbo/eslint-config-solid
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
`eslint.config.js`
|
|
18
|
+
```js
|
|
19
|
+
import eslintConfig from '@pengzhanbo/eslint-config-solid'
|
|
20
|
+
|
|
21
|
+
export default eslintConfig()
|
|
22
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var src_exports = {};
|
|
33
|
+
__export(src_exports, {
|
|
34
|
+
default: () => src_default,
|
|
35
|
+
solid: () => solid,
|
|
36
|
+
solidPreset: () => solidPreset
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(src_exports);
|
|
39
|
+
|
|
40
|
+
// src/factory.ts
|
|
41
|
+
var import_eslint_config2 = require("@pengzhanbo/eslint-config");
|
|
42
|
+
|
|
43
|
+
// src/solid.ts
|
|
44
|
+
var import_eslint_config = require("@pengzhanbo/eslint-config");
|
|
45
|
+
async function solid(options = {}) {
|
|
46
|
+
const {
|
|
47
|
+
files = [import_eslint_config.GLOB_JSX, import_eslint_config.GLOB_TSX],
|
|
48
|
+
overrides = {},
|
|
49
|
+
typescript = true
|
|
50
|
+
} = options;
|
|
51
|
+
const pluginSolid = await (0, import_eslint_config.interopDefault)(import("eslint-plugin-solid"));
|
|
52
|
+
const rules = typescript ? pluginSolid.configs.typescript.rules : pluginSolid.configs.recommended.rules;
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
name: "config:solid:setup",
|
|
56
|
+
plugins: {
|
|
57
|
+
solid: pluginSolid
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
files,
|
|
62
|
+
languageOptions: {
|
|
63
|
+
parserOptions: {
|
|
64
|
+
ecmaFeatures: {
|
|
65
|
+
jsx: true
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
name: "config:solid:rules",
|
|
70
|
+
rules: {
|
|
71
|
+
...rules,
|
|
72
|
+
"solid/components-return-once": "error",
|
|
73
|
+
"solid/style-prop": "error",
|
|
74
|
+
...overrides
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/preset.ts
|
|
81
|
+
var solidPreset = (options) => {
|
|
82
|
+
return [solid({
|
|
83
|
+
overrides: options.overrides.solid,
|
|
84
|
+
typescript: !!options.typescript
|
|
85
|
+
})];
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/factory.ts
|
|
89
|
+
var eslintSolidConfig = (0, import_eslint_config2.createConfig)(solidPreset);
|
|
90
|
+
|
|
91
|
+
// src/index.ts
|
|
92
|
+
__reExport(src_exports, require("@pengzhanbo/eslint-config"), module.exports);
|
|
93
|
+
var src_default = eslintSolidConfig;
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
solid,
|
|
97
|
+
solidPreset,
|
|
98
|
+
...require("@pengzhanbo/eslint-config")
|
|
99
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _pengzhanbo_eslint_config from '@pengzhanbo/eslint-config';
|
|
2
|
+
import { OptionsHasTypeScript, OptionsOverrides, OptionsStylistic, OptionsFiles, FlatConfigItem, PresetItem } from '@pengzhanbo/eslint-config';
|
|
3
|
+
export * from '@pengzhanbo/eslint-config';
|
|
4
|
+
|
|
5
|
+
declare const eslintSolidConfig: typeof _pengzhanbo_eslint_config.default;
|
|
6
|
+
|
|
7
|
+
declare function solid(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<FlatConfigItem[]>;
|
|
8
|
+
|
|
9
|
+
declare const solidPreset: PresetItem;
|
|
10
|
+
|
|
11
|
+
export { eslintSolidConfig as default, solid, solidPreset };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _pengzhanbo_eslint_config from '@pengzhanbo/eslint-config';
|
|
2
|
+
import { OptionsHasTypeScript, OptionsOverrides, OptionsStylistic, OptionsFiles, FlatConfigItem, PresetItem } from '@pengzhanbo/eslint-config';
|
|
3
|
+
export * from '@pengzhanbo/eslint-config';
|
|
4
|
+
|
|
5
|
+
declare const eslintSolidConfig: typeof _pengzhanbo_eslint_config.default;
|
|
6
|
+
|
|
7
|
+
declare function solid(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<FlatConfigItem[]>;
|
|
8
|
+
|
|
9
|
+
declare const solidPreset: PresetItem;
|
|
10
|
+
|
|
11
|
+
export { eslintSolidConfig as default, solid, solidPreset };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/factory.ts
|
|
2
|
+
import { createConfig } from "@pengzhanbo/eslint-config";
|
|
3
|
+
|
|
4
|
+
// src/solid.ts
|
|
5
|
+
import { GLOB_JSX, GLOB_TSX, interopDefault } from "@pengzhanbo/eslint-config";
|
|
6
|
+
async function solid(options = {}) {
|
|
7
|
+
const {
|
|
8
|
+
files = [GLOB_JSX, GLOB_TSX],
|
|
9
|
+
overrides = {},
|
|
10
|
+
typescript = true
|
|
11
|
+
} = options;
|
|
12
|
+
const pluginSolid = await interopDefault(import("eslint-plugin-solid"));
|
|
13
|
+
const rules = typescript ? pluginSolid.configs.typescript.rules : pluginSolid.configs.recommended.rules;
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
name: "config:solid:setup",
|
|
17
|
+
plugins: {
|
|
18
|
+
solid: pluginSolid
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
files,
|
|
23
|
+
languageOptions: {
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaFeatures: {
|
|
26
|
+
jsx: true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
name: "config:solid:rules",
|
|
31
|
+
rules: {
|
|
32
|
+
...rules,
|
|
33
|
+
"solid/components-return-once": "error",
|
|
34
|
+
"solid/style-prop": "error",
|
|
35
|
+
...overrides
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/preset.ts
|
|
42
|
+
var solidPreset = (options) => {
|
|
43
|
+
return [solid({
|
|
44
|
+
overrides: options.overrides.solid,
|
|
45
|
+
typescript: !!options.typescript
|
|
46
|
+
})];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// src/factory.ts
|
|
50
|
+
var eslintSolidConfig = createConfig(solidPreset);
|
|
51
|
+
|
|
52
|
+
// src/index.ts
|
|
53
|
+
export * from "@pengzhanbo/eslint-config";
|
|
54
|
+
var src_default = eslintSolidConfig;
|
|
55
|
+
export {
|
|
56
|
+
src_default as default,
|
|
57
|
+
solid,
|
|
58
|
+
solidPreset
|
|
59
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pengzhanbo/eslint-config-solid",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "pengzhanbo <q942450674@outlook.com> (https://github/pengzhanbo/)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/pengzhanbo/configs#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git@github.com:pengzhanbo/configs.git",
|
|
11
|
+
"directory": "packages/eslint-config-solid"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"eslint-config",
|
|
15
|
+
"solid-js"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"require": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"main": "dist/index.js",
|
|
31
|
+
"types": "dist/index.d.ts",
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"eslint": ">=8.40.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@typescript-eslint/parser": "^6.12.0",
|
|
40
|
+
"eslint-plugin-solid": "^0.13.0",
|
|
41
|
+
"@pengzhanbo/eslint-config": "1.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"eslint": "^8.54.0",
|
|
45
|
+
"eslint-flat-config-viewer": "^0.1.3",
|
|
46
|
+
"tsup": "^8.0.1"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"dev": "tsup src/index.ts --format esm --watch & eslint-flat-config-viewer",
|
|
50
|
+
"build": "tsup src/index.ts --format esm,cjs --clean --dts --shims",
|
|
51
|
+
"stub": "tsup src/index.ts --format esm"
|
|
52
|
+
}
|
|
53
|
+
}
|