@curev/eslint-config 0.2.2 → 0.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 +70 -0
- package/dist/chunk-TMQW6NVO.js +69 -0
- package/dist/dist-QAUNCL3U.js +226708 -0
- package/dist/index.cjs +228976 -0
- package/dist/index.d.cts +516 -0
- package/dist/index.d.ts +516 -0
- package/dist/index.js +2153 -0
- package/package.json +131 -10
- package/index.js +0 -5
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @curev/eslint-config
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/@curev/eslint-config)
|
|
4
|
+
|
|
5
|
+
- Single quotes, no semi
|
|
6
|
+
- Auto fix for formatting (aimed to be used standalone without Prettier)
|
|
7
|
+
- Designed to work with TypeScript, Vue out-of-box
|
|
8
|
+
- Lint also for json, yaml, markdown
|
|
9
|
+
- Sorted imports, dangling commas for cleaner commit diff
|
|
10
|
+
- Reasonable defaults, best practices, only one-line of config
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
### Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add -D eslint @curev/eslint-config
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Config `.eslintrc`
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"extends": "@curev"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
> You don't need `.eslintignore` normally as it has been provided by the preset.
|
|
29
|
+
|
|
30
|
+
### Add script for package.json
|
|
31
|
+
|
|
32
|
+
For example:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"scripts": {
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"lint:fix": "eslint . --fix"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Config VS Code auto fix
|
|
44
|
+
|
|
45
|
+
Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and create `.vscode/settings.json`
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"prettier.enable": false,
|
|
50
|
+
"editor.formatOnSave": false,
|
|
51
|
+
"editor.codeActionsOnSave": {
|
|
52
|
+
"source.fixAll.eslint": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Extended Reading
|
|
58
|
+
|
|
59
|
+
Learn more about the context - [Why I don't use Prettier](https://antfu.me/posts/why-not-prettier).
|
|
60
|
+
|
|
61
|
+
## Check Also
|
|
62
|
+
|
|
63
|
+
- [antfu/dotfiles](https://github.com/antfu/dotfiles) - My dotfiles
|
|
64
|
+
- [antfu/vscode-settings](https://github.com/antfu/vscode-settings) - My VS Code settings
|
|
65
|
+
- [antfu/ts-starter](https://github.com/antfu/ts-starter) - My starter template for TypeScript library
|
|
66
|
+
- [antfu/vitesse](https://github.com/antfu/vitesse) - My starter template for Vue & Vite app
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
[MIT](./LICENSE) License © 2019-PRESENT [Anthony Fu](https://github.com/antfu)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
+
}) : x)(function(x) {
|
|
7
|
+
if (typeof require !== "undefined")
|
|
8
|
+
return require.apply(this, arguments);
|
|
9
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
|
+
});
|
|
11
|
+
var __esm = (fn, res) => function __init() {
|
|
12
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
|
+
};
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
+
};
|
|
17
|
+
var __publicField = (obj, key, value) => {
|
|
18
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
var __accessCheck = (obj, member, msg) => {
|
|
22
|
+
if (!member.has(obj))
|
|
23
|
+
throw TypeError("Cannot " + msg);
|
|
24
|
+
};
|
|
25
|
+
var __privateGet = (obj, member, getter) => {
|
|
26
|
+
__accessCheck(obj, member, "read from private field");
|
|
27
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
28
|
+
};
|
|
29
|
+
var __privateAdd = (obj, member, value) => {
|
|
30
|
+
if (member.has(obj))
|
|
31
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
32
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
33
|
+
};
|
|
34
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
35
|
+
__accessCheck(obj, member, "write to private field");
|
|
36
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
37
|
+
return value;
|
|
38
|
+
};
|
|
39
|
+
var __privateMethod = (obj, member, method) => {
|
|
40
|
+
__accessCheck(obj, member, "access private method");
|
|
41
|
+
return method;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// node_modules/.pnpm/tsup@8.0.1_postcss@8.4.33_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
|
|
45
|
+
import { fileURLToPath } from "url";
|
|
46
|
+
import path from "path";
|
|
47
|
+
var getFilename, getDirname, __dirname, __filename;
|
|
48
|
+
var init_esm_shims = __esm({
|
|
49
|
+
"node_modules/.pnpm/tsup@8.0.1_postcss@8.4.33_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
50
|
+
"use strict";
|
|
51
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
52
|
+
getDirname = () => path.dirname(getFilename());
|
|
53
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
54
|
+
__filename = /* @__PURE__ */ getFilename();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
__require,
|
|
60
|
+
__commonJS,
|
|
61
|
+
__publicField,
|
|
62
|
+
__privateGet,
|
|
63
|
+
__privateAdd,
|
|
64
|
+
__privateSet,
|
|
65
|
+
__privateMethod,
|
|
66
|
+
__dirname,
|
|
67
|
+
__filename,
|
|
68
|
+
init_esm_shims
|
|
69
|
+
};
|