@jadeja/ts 1.0.0-alpha.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/CHANGELOG.md +14 -0
- package/CODE_OF_CONDUCT.md +82 -0
- package/CONTRIBUTING.md +103 -0
- package/LICENSE +20 -0
- package/README.md +38 -0
- package/SECURITY.md +11 -0
- package/dist/lib.js +36 -0
- package/dist/lib.js.map +1 -0
- package/dist/oxfmt.js +65 -0
- package/dist/oxfmt.js.map +1 -0
- package/dist/oxlint.js +185 -0
- package/dist/oxlint.js.map +1 -0
- package/dist/src/configs/oxfmt/base.d.ts +42 -0
- package/dist/src/configs/oxfmt/base.d.ts.map +1 -0
- package/dist/src/configs/oxfmt/index.d.ts +4 -0
- package/dist/src/configs/oxfmt/index.d.ts.map +1 -0
- package/dist/src/configs/oxfmt/lib.d.ts +42 -0
- package/dist/src/configs/oxfmt/lib.d.ts.map +1 -0
- package/dist/src/configs/oxfmt/next.d.ts +47 -0
- package/dist/src/configs/oxfmt/next.d.ts.map +1 -0
- package/dist/src/configs/oxfmt/types.d.ts +2 -0
- package/dist/src/configs/oxfmt/types.d.ts.map +1 -0
- package/dist/src/configs/oxlint/base.d.ts +105 -0
- package/dist/src/configs/oxlint/base.d.ts.map +1 -0
- package/dist/src/configs/oxlint/index.d.ts +4 -0
- package/dist/src/configs/oxlint/index.d.ts.map +1 -0
- package/dist/src/configs/oxlint/lib.d.ts +105 -0
- package/dist/src/configs/oxlint/lib.d.ts.map +1 -0
- package/dist/src/configs/oxlint/next.d.ts +151 -0
- package/dist/src/configs/oxlint/next.d.ts.map +1 -0
- package/dist/src/configs/oxlint/types.d.ts +2 -0
- package/dist/src/configs/oxlint/types.d.ts.map +1 -0
- package/dist/src/configs/ts/base.json +12 -0
- package/dist/src/configs/ts/lib.json +9 -0
- package/dist/src/configs/ts/next.json +18 -0
- package/dist/src/lib/debounce.d.ts +9 -0
- package/dist/src/lib/debounce.d.ts.map +1 -0
- package/dist/src/lib/index.d.ts +5 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/logger.d.ts +44 -0
- package/dist/src/lib/logger.d.ts.map +1 -0
- package/dist/src/lib/operations.d.ts +41 -0
- package/dist/src/lib/operations.d.ts.map +1 -0
- package/dist/src/lib/types.d.ts +41 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +8 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/plugins/vite/copy-folders.d.ts +17 -0
- package/dist/src/plugins/vite/copy-folders.d.ts.map +1 -0
- package/dist/src/plugins/vite/index.d.ts +2 -0
- package/dist/src/plugins/vite/index.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/shared.d.ts +34 -0
- package/dist/src/types/shared.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/dist/vite-plugins.js +22 -0
- package/dist/vite-plugins.js.map +1 -0
- package/package.json +119 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0-alpha.0
|
|
4
|
+
|
|
5
|
+
शुभारम्भः
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**TS**
|
|
10
|
+
|
|
11
|
+
All notable changes to this project is documented in this file.
|
|
12
|
+
|
|
13
|
+
The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
|
|
14
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers
|
|
6
|
+
pledge to make participation in our project and our community a harassment-free experience for
|
|
7
|
+
everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level
|
|
8
|
+
of experience, education, socio-economic status, nationality, personal appearance, race, religion,
|
|
9
|
+
or sexual identity and orientation.
|
|
10
|
+
|
|
11
|
+
<br>
|
|
12
|
+
|
|
13
|
+
## Our Standards
|
|
14
|
+
|
|
15
|
+
Examples of behavior that contributes to creating a positive environment include:
|
|
16
|
+
|
|
17
|
+
- Being respectful of differing viewpoints and experiences
|
|
18
|
+
- Gracefully accepting constructive criticism
|
|
19
|
+
- Focusing on what is best for the community
|
|
20
|
+
- Showing empathy towards other community members
|
|
21
|
+
|
|
22
|
+
Examples of unacceptable behavior by participants include:
|
|
23
|
+
|
|
24
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
25
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
26
|
+
- Public or private harassment
|
|
27
|
+
- Publishing others' private information, such as physical or electronic addresses, without explicit
|
|
28
|
+
permission
|
|
29
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
30
|
+
|
|
31
|
+
<br>
|
|
32
|
+
|
|
33
|
+
## Our Responsibilities
|
|
34
|
+
|
|
35
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are
|
|
36
|
+
expected to take appropriate and fair corrective action in response to any instances of unacceptable
|
|
37
|
+
behavior.
|
|
38
|
+
|
|
39
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
|
|
40
|
+
code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, or
|
|
41
|
+
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
|
|
42
|
+
threatening, offensive, or harmful.
|
|
43
|
+
|
|
44
|
+
<br>
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is
|
|
49
|
+
representing the project or its community.
|
|
50
|
+
|
|
51
|
+
Examples of representing a project or community include using an official project e-mail address,
|
|
52
|
+
posting via an official social media account, or acting as an appointed representative at an online
|
|
53
|
+
or offline event.
|
|
54
|
+
|
|
55
|
+
<br>
|
|
56
|
+
|
|
57
|
+
## Enforcement
|
|
58
|
+
|
|
59
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
|
|
60
|
+
the project team at [Red Alert](https://github.com/JadejaHQ/ts/discussions/new?category=red-alert).
|
|
61
|
+
|
|
62
|
+
All complaints will be reviewed and investigated and will result in a response that is deemed
|
|
63
|
+
necessary and appropriate to the circumstances. The project team is obligated to maintain
|
|
64
|
+
confidentiality with regard to the reporter of an incident. Further details of specific enforcement
|
|
65
|
+
policies may be posted separately.
|
|
66
|
+
|
|
67
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
|
|
68
|
+
temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
69
|
+
|
|
70
|
+
<br>
|
|
71
|
+
|
|
72
|
+
## Attribution
|
|
73
|
+
|
|
74
|
+
This Code of Conduct is adapted from the
|
|
75
|
+
[Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at
|
|
76
|
+
[Contributor Covenant Official Site](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
|
|
77
|
+
|
|
78
|
+
<br>
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
_Last updated on May 31, 2026_
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to TS. Contributions are welcome! 🤗
|
|
4
|
+
|
|
5
|
+
We appreciate bug reports, feature requests, code improvements, and any other forms of contribution.
|
|
6
|
+
|
|
7
|
+
To contribute to this project, Please take a moment to review this document **before submitting a
|
|
8
|
+
pull request**.
|
|
9
|
+
|
|
10
|
+
<br>
|
|
11
|
+
|
|
12
|
+
## Reporting Issues
|
|
13
|
+
|
|
14
|
+
If you encounter any issues or bugs, please [Create an Issue](https://github.com/JadejaHQ/ts/issues)
|
|
15
|
+
on our GitHub repository.
|
|
16
|
+
|
|
17
|
+
Provide as much detail as possible to help us reproduce and identify the problem.
|
|
18
|
+
|
|
19
|
+
<br>
|
|
20
|
+
|
|
21
|
+
## Feature Requests
|
|
22
|
+
|
|
23
|
+
If you have an idea for a new feature or enhancement, feel free to create
|
|
24
|
+
[Feature Request](https://github.com/JadejaHQ/ts/discussions/new?category=ideas) on our GitHub
|
|
25
|
+
repository.
|
|
26
|
+
|
|
27
|
+
Describe the feature or enhancement you would like to see, and provide any additional context or
|
|
28
|
+
examples.
|
|
29
|
+
|
|
30
|
+
<br>
|
|
31
|
+
|
|
32
|
+
## Pull Requests
|
|
33
|
+
|
|
34
|
+
We welcome pull requests!
|
|
35
|
+
|
|
36
|
+
**Please ask first before starting work on any significant new features.**
|
|
37
|
+
|
|
38
|
+
It's never a fun experience to have your pull request declined after investing a lot of time and
|
|
39
|
+
effort into a new feature.
|
|
40
|
+
|
|
41
|
+
To avoid this from happening, we request that contributors to first
|
|
42
|
+
[Discuss Pull Request](https://github.com/JadejaHQ/ts/discussions/new?category=pull-request) it.
|
|
43
|
+
|
|
44
|
+
<br>
|
|
45
|
+
|
|
46
|
+
## Contribute
|
|
47
|
+
|
|
48
|
+
1. [Fork The Repository](https://github.com/JadejaHQ/ts/fork).
|
|
49
|
+
- If already forked, then sync the `dev` branch
|
|
50
|
+
2. [Create an Issue](https://github.com/JadejaHQ/ts/issues) or
|
|
51
|
+
[Feature Request](https://github.com/JadejaHQ/ts/discussions/new?category=ideas) if not exist.
|
|
52
|
+
3. Follow Branch naming conventions
|
|
53
|
+
- Name must be in `kebab-case`
|
|
54
|
+
- Name only contain alphanumericals (<kbd>A-Z</kbd>, <kbd>a-z</kbd> and <kbd>0-9</kbd>).
|
|
55
|
+
- Name must start with the type of change
|
|
56
|
+
- `feat` → new functionality
|
|
57
|
+
- `fix` → bug fix
|
|
58
|
+
- `docs` → documentation changes
|
|
59
|
+
- `refactor` → code restructuring without behavior change
|
|
60
|
+
- `test` → tests added or updated
|
|
61
|
+
- `chore` → maintenance / tooling / setup
|
|
62
|
+
- Followed by github issue id
|
|
63
|
+
- > For example, <br> If issue (feature request) url is https://github.com/JadejaHQ/ts/issues/11,
|
|
64
|
+
> <br> then your branch name must be `feat-11`
|
|
65
|
+
4. Create a new branch for your changes from the `dev`.
|
|
66
|
+
- ```shell
|
|
67
|
+
git checkout -b <branch-name> dev
|
|
68
|
+
```
|
|
69
|
+
5. Make your code changes in the new branch.
|
|
70
|
+
6. Ensure your code adheres to the project's coding style and conventions.
|
|
71
|
+
- run `pnpm check`
|
|
72
|
+
7. Push the branch to your forked repository.
|
|
73
|
+
8. Submit a pull request from your forked branch to the main repository (_`dev` branch_).
|
|
74
|
+
|
|
75
|
+
<br>
|
|
76
|
+
|
|
77
|
+
**A project maintainer will review your pull request, provide feedback if necessary, and merge it
|
|
78
|
+
once it meets the project's requirements.**
|
|
79
|
+
|
|
80
|
+
<br><br>
|
|
81
|
+
|
|
82
|
+
## Code Style and Conventions
|
|
83
|
+
|
|
84
|
+
Follow the existing code style and conventions used in the project.
|
|
85
|
+
|
|
86
|
+
Pay attention to naming conventions, formatting, and documentation standards.
|
|
87
|
+
|
|
88
|
+
- `pnpm check`
|
|
89
|
+
- `pnpm fix`
|
|
90
|
+
|
|
91
|
+
<br>
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
By contributing to this project, you acknowledge and agree that any contributions you make will be
|
|
96
|
+
subject to the terms outlined in the project's
|
|
97
|
+
[LICENSE](https://github.com/JadejaHQ/ts/blob/main/LICENSE) file.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
Thank you for your time 🙂
|
|
102
|
+
|
|
103
|
+
_Last updated on May 31, 2026_
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-Present; Pradipsinh Jadeja (jadeja.dev)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
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, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# TS
|
|
2
|
+
|
|
3
|
+
_an opinionated collection of TypeScript tools_
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<br />
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
|
|
11
|
+
Documentation will be added in future releases.
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
## Community
|
|
16
|
+
|
|
17
|
+
For help, discussion, or any other conversation, see
|
|
18
|
+
[Discuss TS on GitHub](https://github.com/JadejaHQ/ts/discussions)
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
If you're interested in contributing to TS, please read our
|
|
25
|
+
[Contributing Guidelines](https://github.com/JadejaHQ/ts/blob/main/CONTRIBUTING.md) **before
|
|
26
|
+
submitting a pull request**.
|
|
27
|
+
|
|
28
|
+
<br />
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
[MIT License](https://github.com/JadejaHQ/ts/blob/main/LICENSE)
|
|
33
|
+
|
|
34
|
+
<br />
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
Thank you for your time 🙂
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
If you believe you have found a security vulnerability, we encourage you to let us know right away.
|
|
4
|
+
|
|
5
|
+
We will investigate all legitimate reports and do our best to quickly fix the problem.
|
|
6
|
+
|
|
7
|
+
Our preference is that you make use of GitHub's private vulnerability reporting feature to disclose
|
|
8
|
+
potential security vulnerabilities in our Open Source Software.
|
|
9
|
+
|
|
10
|
+
To do this, please visit the security tab of the repository and click the
|
|
11
|
+
[Report a vulnerability](https://github.com/JadejaHQ/ts/security/advisories/new) button.
|
package/dist/lib.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/lib/logger.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let t;
|
|
4
|
+
throw t = e instanceof Error ? e.message : typeof e == "string" ? e : String(e), Error(t);
|
|
5
|
+
}, { log: t } = console, n = (e = "-", n = 50) => {
|
|
6
|
+
t(e.repeat(n));
|
|
7
|
+
}, r = (e) => {
|
|
8
|
+
t(`\n${e}\n`);
|
|
9
|
+
}, { warn: i } = console, a = (e) => {
|
|
10
|
+
i(`\n${e}\n`);
|
|
11
|
+
}, o = (e) => typeof e == "string", s = (e) => typeof e == "number", c = (e) => typeof e == "function", l = (e) => Array.isArray(e), u = (e) => !!e && typeof e == "object" && !l(e), d = (t, n) => {
|
|
12
|
+
if (!u(t)) return e("target must be an object");
|
|
13
|
+
if (!u(n)) return e("source must be an object");
|
|
14
|
+
for (let e in n) e in t && u(t[e]) && u(n[e]) ? d(t[e], n[e]) : t[e] = n[e];
|
|
15
|
+
return t;
|
|
16
|
+
}, f = (n) => {
|
|
17
|
+
try {
|
|
18
|
+
if (u(n)) return { ...structuredClone(n) };
|
|
19
|
+
if (l(n)) return [...structuredClone(n)];
|
|
20
|
+
} catch (n) {
|
|
21
|
+
t("Any part of the input data is not serializable."), e(n);
|
|
22
|
+
}
|
|
23
|
+
return n;
|
|
24
|
+
}, p = (e) => new RegExp(e), m, h = (e, t = 1e3) => {
|
|
25
|
+
clearTimeout(m), m = setTimeout(() => {
|
|
26
|
+
e(), clearTimeout(m);
|
|
27
|
+
}, t);
|
|
28
|
+
}, g = async (e = 250) => new Promise((t) => {
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
t();
|
|
31
|
+
}, e);
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { h as debounce, f as deepCopy, d as deepMergeObj, p as freshRegex, l as isArr, c as isFn, s as isNum, u as isObj, o as isStr, t as log, n as logDivider, r as logNewLine, g as sleep, e as throwError, i as warn, a as warnNewLine };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=lib.js.map
|
package/dist/lib.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.js","names":[],"sources":["../src/lib/logger.ts","../src/lib/types.ts","../src/lib/operations.ts","../src/lib/debounce.ts","../src/lib/utils.ts"],"sourcesContent":["/**\n * throws an error with the provided message.\n *\n * @param err - The error message to throw.\n */\nexport const throwError = <T>(err: T) => {\n //\n let errMsg: string;\n\n if (err instanceof Error) {\n errMsg = err.message;\n } else if (typeof err === \"string\") {\n errMsg = err;\n } else {\n errMsg = String(err);\n }\n\n throw new Error(errMsg);\n};\n\n/* ============================================================================================= */\n\n/**\n * logs a message to the console.\n *\n * @param msg - The message to log.\n */\nexport const { log } = console;\n\n/* ============================================================================================= */\n\n/**\n * logs a divider line to the console.\n *\n * @param divider - The character to use for the divider (default is \"-\").\n * @param count - The number of times to repeat the divider character (default is 50).\n */\nexport const logDivider = (divider = \"-\", count = 50) => {\n log(divider.repeat(count));\n};\n\n/* ============================================================================================= */\n\n/**\n * logs a new line with an optional message to the console.\n *\n * @param msg - The message to include in the new line (optional).\n */\nexport const logNewLine = <T>(msg?: T) => {\n log(`\\n${msg}\\n`);\n};\n\n/* ============================================================================================= */\n\n/**\n * logs a warning message to the console.\n *\n * @param msg - The warning message to log.\n */\nexport const { warn } = console;\n\n/* ============================================================================================= */\n\n/**\n * logs a new line with an optional warning message to the console.\n *\n * @param msg - The warning message to include in the new line (optional).\n */\nexport const warnNewLine = <T>(msg?: T) => {\n warn(`\\n${msg}\\n`);\n};\n","/**\n * checks if the provided data is a string.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is a string, otherwise `false`.\n */\nexport const isStr = <T>(arg: T) => typeof arg === \"string\";\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is a number.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is a number, otherwise `false`.\n */\nexport const isNum = <T>(arg: T) => typeof arg === \"number\";\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is a function.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is a function, otherwise `false`.\n */\nexport const isFn = <T>(arg: T) => typeof arg === \"function\";\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is an array.\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is an array, otherwise `false`.\n */\nexport const isArr = <T>(arg: T) => Array.isArray(arg);\n\n/* ============================================================================================= */\n\n/**\n * checks if the provided data is an object (not an array, or null).\n *\n * @param arg - The data to check.\n *\n * @returns `true` if the data is an object, otherwise `false`.\n */\nexport const isObj = <T>(arg: T) => Boolean(arg) && typeof arg === \"object\" && !isArr(arg);\n","import { log, throwError } from \"./logger.ts\";\nimport { isArr, isObj } from \"./types.ts\";\n\n/* ============================================================================================= */\n\n/**\n * recursively merges the properties of the source object into the target object.\n *\n * @param target - The target object to merge into. Must be an object.\n * @param source - The source object to merge from. Must be an object.\n *\n * @returns `source` object deep (nested) merge into `target` object.\n *\n * @throws If either `target` or `source` is not an object.\n */\nexport const deepMergeObj = <T, U>(target: T, source: U) => {\n //\n if (!isObj(target)) {\n return throwError(\"target must be an object\");\n }\n if (!isObj(source)) {\n return throwError(\"source must be an object\");\n }\n\n for (const key in source) {\n // oxlint-disable typescript/no-unsafe-member-access\n if (key in (target as never) && isObj((target as never)[key]) && isObj(source[key])) {\n // oxlint-disable typescript/no-unsafe-member-access\n deepMergeObj<typeof target, typeof source>((target as never)[key], (source as never)[key]);\n } else {\n // oxlint-disable typescript/no-unsafe-member-access, typescript/no-explicit-any\n (target as any)[key] = source[key];\n }\n }\n\n return target as T & U;\n};\n\n/* ============================================================================================= */\n\n/**\n * creates a deep copy of the given data using `structuredClone`.\n *\n * If the input is not an object or array, the original data is returned.\n *\n * @param data - The data to be copied. Can be an object or array.\n *\n * @returns A deep copy of the input data.\n *\n * @throws If any part of the input data is not serializable.\n */\nexport const deepCopy = <T>(data: T): T => {\n //\n try {\n //\n if (isObj(data)) {\n return { ...structuredClone(data) };\n } else if (isArr(data)) {\n return [...structuredClone(data)] as T;\n }\n //\n } catch (error) {\n log(\"Any part of the input data is not serializable.\");\n throwError(error);\n }\n\n return data;\n};\n\n/* ============================================================================================= */\n\n/**\n * returns a fresh RegExp instance cloned from the provided input. This ensures the internal\n * `lastIndex` state is reset to `0`, making the regex safe to reuse with stateful flags like `g` or\n * `y` across multiple operations (e.g. `test`, `replace`, `exec`), particularly in long-lived\n * runtimes such as HMR or shared modules.\n *\n * The returned RegExp preserves: - pattern source - flags (g, i, m, s, u, y, d, etc.)\n *\n * @example\n * -fresh(LCH_COLOR_FORMAT_PATTERN).test(rawColor);\n * -text.replace(fresh(LCH_COLOR_FORMAT_PATTERN), transformer);\n *\n * @param regex - The RegExp instance to clone.\n *\n * @returns A new RegExp instance with identical pattern and flags.\n */\n// reset lastIndex via new instance\nexport const freshRegex = (regex: RegExp) => new RegExp(regex);\n","// global variable for this module instance\nlet timer: ReturnType<typeof setTimeout>;\n\n/**\n * prevent duplicate function call in specified time period\n *\n * @param fn - an anonymous function to delay execution\n * @param delay - delay for provided function execution (default `1000` in milliseconds)\n */\nconst debounce = (fn: () => void, delay = 1000) => {\n //\n clearTimeout(timer);\n\n timer = setTimeout(() => {\n fn();\n clearTimeout(timer);\n }, delay);\n};\n\n/* ============================================================================================= */\n\nexport default debounce;\n","export { default as debounce } from \"./debounce.ts\";\n\n/**\n * put the app to sleep for defined time for artificial delay to improve the UX\n *\n * @param time - time for artificial delay (default `250)\n */\n// oxlint-disable eslint/require-await\nexport const sleep = async (time = 250): Promise<void> =>\n new Promise<void>((resolve) => {\n setTimeout(() => {\n resolve();\n }, time);\n });\n"],"mappings":";AAKA,IAAa,KAAiB,MAAW;CAEvC,IAAI;CAUJ,MARA,AAKE,IALE,aAAe,QACR,EAAI,UACJ,OAAO,KAAQ,WACf,IAEA,OAAO,EAAI,EAGZ,MAAM,EAAO;GAUZ,EAAE,WAAQ,SAUV,KAAc,IAAU,KAAK,IAAQ,OAAO;CACvD,EAAI,EAAQ,OAAO,EAAM,CAAC;GAUf,KAAiB,MAAY;CACxC,EAAI,KAAK,EAAI,IAAI;GAUN,EAAE,YAAS,SASX,KAAkB,MAAY;CACzC,EAAK,KAAK,EAAI,IAAI;GC9DP,KAAY,MAAW,OAAO,KAAQ,UAWtC,KAAY,MAAW,OAAO,KAAQ,UAWtC,KAAW,MAAW,OAAO,KAAQ,YAWrC,KAAY,MAAW,MAAM,QAAQ,EAAI,EAWzC,KAAY,MAAW,EAAQ,KAAQ,OAAO,KAAQ,YAAY,CAAC,EAAM,EAAI,ECpC7E,KAAsB,GAAW,MAAc;CAE1D,IAAI,CAAC,EAAM,EAAO,EAChB,OAAO,EAAW,2BAA2B;CAE/C,IAAI,CAAC,EAAM,EAAO,EAChB,OAAO,EAAW,2BAA2B;CAG/C,KAAK,IAAM,KAAO,GAEhB,AAAI,KAAQ,KAAoB,EAAO,EAAiB,GAAK,IAAI,EAAM,EAAO,GAAK,GAEjF,EAA4C,EAAiB,IAAO,EAAiB,GAAK,GAG1F,EAAgB,KAAO,EAAO;CAIlC,OAAO;GAgBI,KAAe,MAAe;CAEzC,IAAI;EAEF,IAAI,EAAM,EAAK,EACb,OAAO,EAAE,GAAG,gBAAgB,EAAK,EAAE;EAC9B,IAAI,EAAM,EAAK,EACpB,OAAO,CAAC,GAAG,gBAAgB,EAAK,CAAC;UAG5B,GAAO;EAEd,AADA,EAAI,kDAAkD,EACtD,EAAW,EAAM;;CAGnB,OAAO;GAsBI,KAAc,MAAkB,IAAI,OAAO,EAAM,ECvF1D,GAQE,KAAY,GAAgB,IAAQ,QAAS;CAIjD,AAFA,aAAa,EAAM,EAEnB,IAAQ,iBAAiB;EAEvB,AADA,GAAI,EACJ,aAAa,EAAM;IAClB,EAAM;GCRE,IAAQ,OAAO,IAAO,QACjC,IAAI,SAAe,MAAY;CAC7B,iBAAiB;EACf,GAAS;IACR,EAAK;EACR"}
|
package/dist/oxfmt.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region src/configs/oxfmt/base.ts
|
|
2
|
+
var e = {
|
|
3
|
+
arrowParens: "always",
|
|
4
|
+
bracketSpacing: !0,
|
|
5
|
+
endOfLine: "lf",
|
|
6
|
+
ignorePatterns: [],
|
|
7
|
+
insertFinalNewline: !0,
|
|
8
|
+
jsdoc: {
|
|
9
|
+
addDefaultToDescription: !0,
|
|
10
|
+
bracketSpacing: !0,
|
|
11
|
+
capitalizeDescriptions: !1,
|
|
12
|
+
commentLineStrategy: "multiline",
|
|
13
|
+
descriptionTag: !1,
|
|
14
|
+
descriptionWithDot: !1,
|
|
15
|
+
keepUnparsableExampleIndent: !0,
|
|
16
|
+
lineWrappingStyle: "greedy",
|
|
17
|
+
preferCodeFences: !0,
|
|
18
|
+
separateReturnsFromParam: !0,
|
|
19
|
+
separateTagGroups: !0
|
|
20
|
+
},
|
|
21
|
+
objectWrap: "preserve",
|
|
22
|
+
printWidth: 100,
|
|
23
|
+
proseWrap: "always",
|
|
24
|
+
quoteProps: "as-needed",
|
|
25
|
+
semi: !0,
|
|
26
|
+
singleQuote: !1,
|
|
27
|
+
sortImports: {
|
|
28
|
+
groups: [
|
|
29
|
+
["default-builtin", "named-builtin"],
|
|
30
|
+
"wildcard-external",
|
|
31
|
+
["default-external", "named-external"],
|
|
32
|
+
["default-internal", "named-internal"],
|
|
33
|
+
["default-parent", "named-parent"],
|
|
34
|
+
["default-sibling", "named-sibling"],
|
|
35
|
+
["default-index", "named-index"],
|
|
36
|
+
"unknown",
|
|
37
|
+
"type-external",
|
|
38
|
+
"type-internal",
|
|
39
|
+
"type-parent",
|
|
40
|
+
"type-sibling"
|
|
41
|
+
],
|
|
42
|
+
ignoreCase: !0,
|
|
43
|
+
internalPattern: ["@/"],
|
|
44
|
+
newlinesBetween: !0,
|
|
45
|
+
order: "asc",
|
|
46
|
+
partitionByComment: !0,
|
|
47
|
+
partitionByNewline: !1,
|
|
48
|
+
sortSideEffects: !1
|
|
49
|
+
},
|
|
50
|
+
sortPackageJson: !1,
|
|
51
|
+
tabWidth: 2,
|
|
52
|
+
trailingComma: "all",
|
|
53
|
+
useTabs: !1
|
|
54
|
+
}, t = { ...e }, n = {
|
|
55
|
+
...e,
|
|
56
|
+
bracketSameLine: !1,
|
|
57
|
+
embeddedLanguageFormatting: "auto",
|
|
58
|
+
htmlWhitespaceSensitivity: "css",
|
|
59
|
+
jsxSingleQuote: !1,
|
|
60
|
+
singleAttributePerLine: !1
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { e as base, t as lib, n as next };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=oxfmt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxfmt.js","names":[],"sources":["../src/configs/oxfmt/base.ts","../src/configs/oxfmt/lib.ts","../src/configs/oxfmt/next.ts"],"sourcesContent":["import type { OxfmtConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst base = {\n arrowParens: \"always\",\n bracketSpacing: true,\n endOfLine: \"lf\",\n ignorePatterns: [],\n insertFinalNewline: true,\n jsdoc: {\n addDefaultToDescription: true,\n bracketSpacing: true,\n capitalizeDescriptions: false,\n commentLineStrategy: \"multiline\",\n descriptionTag: false,\n descriptionWithDot: false,\n keepUnparsableExampleIndent: true,\n lineWrappingStyle: \"greedy\",\n preferCodeFences: true,\n separateReturnsFromParam: true,\n separateTagGroups: true,\n },\n objectWrap: \"preserve\",\n printWidth: 100,\n proseWrap: \"always\",\n quoteProps: \"as-needed\",\n semi: true,\n singleQuote: false,\n sortImports: {\n groups: [\n [\"default-builtin\", \"named-builtin\"],\n \"wildcard-external\",\n [\"default-external\", \"named-external\"],\n [\"default-internal\", \"named-internal\"],\n [\"default-parent\", \"named-parent\"],\n [\"default-sibling\", \"named-sibling\"],\n [\"default-index\", \"named-index\"],\n \"unknown\",\n \"type-external\",\n \"type-internal\",\n \"type-parent\",\n \"type-sibling\",\n ],\n ignoreCase: true,\n internalPattern: [\"@/\"],\n newlinesBetween: true,\n order: \"asc\",\n partitionByComment: true,\n partitionByNewline: false,\n sortSideEffects: false,\n },\n sortPackageJson: false,\n tabWidth: 2,\n trailingComma: \"all\",\n useTabs: false,\n} satisfies OxfmtConfig;\n\n/* ============================================================================================= */\n\nexport default base;\n","import base from \"./base.ts\";\n\nimport type { OxfmtConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst lib = { ...base } satisfies OxfmtConfig;\n\n/* ============================================================================================= */\n\nexport default lib;\n","import base from \"./base.ts\";\n\nimport type { OxfmtConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst next = {\n ...base,\n bracketSameLine: false,\n embeddedLanguageFormatting: \"auto\",\n htmlWhitespaceSensitivity: \"css\",\n jsxSingleQuote: false,\n singleAttributePerLine: false,\n} satisfies OxfmtConfig;\n\n/* ============================================================================================= */\n\nexport default next;\n"],"mappings":";AAIA,IAAM,IAAO;CACX,aAAa;CACb,gBAAgB;CAChB,WAAW;CACX,gBAAgB,EAAE;CAClB,oBAAoB;CACpB,OAAO;EACL,yBAAyB;EACzB,gBAAgB;EAChB,wBAAwB;EACxB,qBAAqB;EACrB,gBAAgB;EAChB,oBAAoB;EACpB,6BAA6B;EAC7B,mBAAmB;EACnB,kBAAkB;EAClB,0BAA0B;EAC1B,mBAAmB;EACpB;CACD,YAAY;CACZ,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,MAAM;CACN,aAAa;CACb,aAAa;EACX,QAAQ;GACN,CAAC,mBAAmB,gBAAgB;GACpC;GACA,CAAC,oBAAoB,iBAAiB;GACtC,CAAC,oBAAoB,iBAAiB;GACtC,CAAC,kBAAkB,eAAe;GAClC,CAAC,mBAAmB,gBAAgB;GACpC,CAAC,iBAAiB,cAAc;GAChC;GACA;GACA;GACA;GACA;GACD;EACD,YAAY;EACZ,iBAAiB,CAAC,KAAK;EACvB,iBAAiB;EACjB,OAAO;EACP,oBAAoB;EACpB,oBAAoB;EACpB,iBAAiB;EAClB;CACD,iBAAiB;CACjB,UAAU;CACV,eAAe;CACf,SAAS;CACV,EClDK,IAAM,EAAE,GAAG,GAAM,ECAjB,IAAO;CACX,GAAG;CACH,iBAAiB;CACjB,4BAA4B;CAC5B,2BAA2B;CAC3B,gBAAgB;CAChB,wBAAwB;CACzB"}
|
package/dist/oxlint.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
//#region src/configs/oxlint/base.ts
|
|
2
|
+
var e = {
|
|
3
|
+
categories: {
|
|
4
|
+
correctness: "error",
|
|
5
|
+
nursery: "warn",
|
|
6
|
+
pedantic: "error",
|
|
7
|
+
perf: "error",
|
|
8
|
+
restriction: "error",
|
|
9
|
+
style: "error",
|
|
10
|
+
suspicious: "error"
|
|
11
|
+
},
|
|
12
|
+
env: {
|
|
13
|
+
builtin: !0,
|
|
14
|
+
node: !0
|
|
15
|
+
},
|
|
16
|
+
options: {
|
|
17
|
+
denyWarnings: !1,
|
|
18
|
+
reportUnusedDisableDirectives: "error",
|
|
19
|
+
respectEslintDisableDirectives: !1,
|
|
20
|
+
typeAware: !0,
|
|
21
|
+
typeCheck: !1
|
|
22
|
+
},
|
|
23
|
+
plugins: [
|
|
24
|
+
"eslint",
|
|
25
|
+
"import",
|
|
26
|
+
"jsdoc",
|
|
27
|
+
"node",
|
|
28
|
+
"oxc",
|
|
29
|
+
"promise",
|
|
30
|
+
"typescript",
|
|
31
|
+
"unicorn"
|
|
32
|
+
],
|
|
33
|
+
rules: {
|
|
34
|
+
"capitalized-comments": [
|
|
35
|
+
"error",
|
|
36
|
+
"never",
|
|
37
|
+
{
|
|
38
|
+
block: { ignorePattern: "/\\/\\*\\s*=+\\s*[\\r\\n]+(?:[\\s\\S]*?)[\\r\\n]+\\s*=+\\s*\\*\\//m" },
|
|
39
|
+
ignorePattern: "^([A-Z]{2,}|[A-Z][A-Z0-9_-]*)(\\b|:)"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"eslint/class-methods-use-this": "off",
|
|
43
|
+
"eslint/complexity": ["error", { max: 30 }],
|
|
44
|
+
"eslint/id-length": ["error", {
|
|
45
|
+
checkGeneric: !1,
|
|
46
|
+
exceptions: [
|
|
47
|
+
"a",
|
|
48
|
+
"b",
|
|
49
|
+
"i",
|
|
50
|
+
"j",
|
|
51
|
+
"K",
|
|
52
|
+
"T",
|
|
53
|
+
"U",
|
|
54
|
+
"x"
|
|
55
|
+
]
|
|
56
|
+
}],
|
|
57
|
+
"eslint/init-declarations": "off",
|
|
58
|
+
"eslint/max-lines-per-function": ["error", {
|
|
59
|
+
max: 120,
|
|
60
|
+
skipBlankLines: !0,
|
|
61
|
+
skipComments: !0
|
|
62
|
+
}],
|
|
63
|
+
"eslint/max-params": ["error", { max: 4 }],
|
|
64
|
+
"eslint/max-statements": ["error", { max: 40 }],
|
|
65
|
+
"eslint/no-await-in-loop": "off",
|
|
66
|
+
"eslint/no-continue": "off",
|
|
67
|
+
"eslint/no-duplicate-imports": ["error", { allowSeparateTypeImports: !0 }],
|
|
68
|
+
"eslint/no-magic-numbers": "off",
|
|
69
|
+
"eslint/no-plusplus": "off",
|
|
70
|
+
"eslint/no-ternary": "off",
|
|
71
|
+
"eslint/no-underscore-dangle": ["error", { allow: [] }],
|
|
72
|
+
"eslint/no-use-before-define": "off",
|
|
73
|
+
"eslint/no-warning-comments": "off",
|
|
74
|
+
"eslint/require-unicode-regexp": "off",
|
|
75
|
+
"eslint/sort-imports": "off",
|
|
76
|
+
"eslint/sort-keys": "off",
|
|
77
|
+
"import/exports-last": "off",
|
|
78
|
+
"import/group-exports": "off",
|
|
79
|
+
"import/max-dependencies": ["error", { max: 30 }],
|
|
80
|
+
"import/no-default-export": "off",
|
|
81
|
+
"import/no-named-default": "off",
|
|
82
|
+
"import/no-named-export": "off",
|
|
83
|
+
"import/no-nodejs-modules": "off",
|
|
84
|
+
"jsdoc/require-param-type": "off",
|
|
85
|
+
"jsdoc/require-returns": "off",
|
|
86
|
+
"jsdoc/require-returns-type": "off",
|
|
87
|
+
"no-unused-vars": ["error", {
|
|
88
|
+
args: "all",
|
|
89
|
+
argsIgnorePattern: "^_",
|
|
90
|
+
caughtErrors: "all",
|
|
91
|
+
caughtErrorsIgnorePattern: "^_",
|
|
92
|
+
destructuredArrayIgnorePattern: "^_"
|
|
93
|
+
}],
|
|
94
|
+
"oxc/no-async-await": "off",
|
|
95
|
+
"oxc/no-optional-chaining": "off",
|
|
96
|
+
"oxc/no-rest-spread-properties": "off",
|
|
97
|
+
"promise/avoid-new": "off",
|
|
98
|
+
"typescript/explicit-function-return-type": "off",
|
|
99
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
100
|
+
"typescript/no-inferrable-types": "off",
|
|
101
|
+
"typescript/no-unnecessary-condition": "off",
|
|
102
|
+
"typescript/no-unnecessary-type-parameters": "off",
|
|
103
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
104
|
+
"typescript/no-useless-default-assignment": "off",
|
|
105
|
+
"typescript/prefer-readonly-parameter-types": "off",
|
|
106
|
+
"typescript/restrict-template-expressions": "off",
|
|
107
|
+
"typescript/strict-boolean-expressions": "off",
|
|
108
|
+
"unicorn/no-null": "off",
|
|
109
|
+
"unicorn/no-lonely-if": "off",
|
|
110
|
+
"unicorn/switch-case-braces": "off"
|
|
111
|
+
}
|
|
112
|
+
}, t = e.rules["eslint/id-length"];
|
|
113
|
+
t[1].exceptions = [
|
|
114
|
+
...t[1].exceptions,
|
|
115
|
+
"h",
|
|
116
|
+
"m",
|
|
117
|
+
"p",
|
|
118
|
+
"w",
|
|
119
|
+
"y",
|
|
120
|
+
"z"
|
|
121
|
+
];
|
|
122
|
+
var n = {
|
|
123
|
+
...e,
|
|
124
|
+
rules: {
|
|
125
|
+
...e.rules,
|
|
126
|
+
"eslint/id-length": t
|
|
127
|
+
}
|
|
128
|
+
}, r = {
|
|
129
|
+
...e,
|
|
130
|
+
env: {
|
|
131
|
+
...e.env,
|
|
132
|
+
browser: !0
|
|
133
|
+
},
|
|
134
|
+
jsPlugins: [{
|
|
135
|
+
name: "react-hooks-js",
|
|
136
|
+
specifier: "eslint-plugin-react-hooks"
|
|
137
|
+
}],
|
|
138
|
+
plugins: [
|
|
139
|
+
...e.plugins,
|
|
140
|
+
"jsx-a11y",
|
|
141
|
+
"nextjs",
|
|
142
|
+
"react",
|
|
143
|
+
"react-perf"
|
|
144
|
+
],
|
|
145
|
+
rules: {
|
|
146
|
+
...e.rules,
|
|
147
|
+
"eslint/no-undefined": "off",
|
|
148
|
+
"import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
|
|
149
|
+
"react/forbid-component-props": ["error", { forbid: ["style"] }],
|
|
150
|
+
"react/jsx-filename-extension": ["error", { extensions: ["jsx", "tsx"] }],
|
|
151
|
+
"react/jsx-pascal-case": ["error", { allowAllCaps: !0 }],
|
|
152
|
+
"react/jsx-props-no-spreading": "off",
|
|
153
|
+
"react/jsx-max-depth": ["error", { max: 6 }],
|
|
154
|
+
"react/no-multi-comp": ["error", { ignoreStateless: !0 }],
|
|
155
|
+
"react/only-export-components": ["error", { allowExportNames: [
|
|
156
|
+
"dynamicParams",
|
|
157
|
+
"generateMetadata",
|
|
158
|
+
"generateStaticParams",
|
|
159
|
+
"metadata",
|
|
160
|
+
"variants"
|
|
161
|
+
] }],
|
|
162
|
+
"react/react-in-jsx-scope": "off",
|
|
163
|
+
"react-hooks-js/error-boundaries": "error",
|
|
164
|
+
"react-hooks-js/config": "error",
|
|
165
|
+
"react-hooks-js/globals": "error",
|
|
166
|
+
"react-hooks-js/immutability": "error",
|
|
167
|
+
"react-hooks-js/incompatible-library": "error",
|
|
168
|
+
"react-hooks-js/preserve-manual-memoization": "error",
|
|
169
|
+
"react-hooks-js/purity": "error",
|
|
170
|
+
"react-hooks-js/refs": "error",
|
|
171
|
+
"react-hooks-js/set-state-in-effect": "error",
|
|
172
|
+
"react-hooks-js/set-state-in-render": "error",
|
|
173
|
+
"react-hooks-js/static-components": "error",
|
|
174
|
+
"react-hooks-js/unsupported-syntax": "error",
|
|
175
|
+
"react-hooks-js/use-memo": "error",
|
|
176
|
+
"react-perf/jsx-no-jsx-as-prop": "off",
|
|
177
|
+
"react-perf/jsx-no-new-array-as-prop": "off",
|
|
178
|
+
"react-perf/jsx-no-new-function-as-prop": "off",
|
|
179
|
+
"react-perf/jsx-no-new-object-as-prop": "off"
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
//#endregion
|
|
183
|
+
export { e as base, n as lib, r as next };
|
|
184
|
+
|
|
185
|
+
//# sourceMappingURL=oxlint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxlint.js","names":[],"sources":["../src/configs/oxlint/base.ts","../src/configs/oxlint/lib.ts","../src/configs/oxlint/next.ts"],"sourcesContent":["import type { OxlintConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst base = {\n categories: {\n correctness: \"error\",\n nursery: \"warn\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n env: {\n builtin: true,\n node: true,\n },\n options: {\n denyWarnings: false,\n reportUnusedDisableDirectives: \"error\",\n respectEslintDisableDirectives: false,\n typeAware: true,\n typeCheck: false,\n },\n plugins: [\"eslint\", \"import\", \"jsdoc\", \"node\", \"oxc\", \"promise\", \"typescript\", \"unicorn\"],\n rules: {\n \"capitalized-comments\": [\n \"error\",\n \"never\",\n {\n block: {\n ignorePattern: \"/\\\\/\\\\*\\\\s*=+\\\\s*[\\\\r\\\\n]+(?:[\\\\s\\\\S]*?)[\\\\r\\\\n]+\\\\s*=+\\\\s*\\\\*\\\\//m\",\n },\n ignorePattern: \"^([A-Z]{2,}|[A-Z][A-Z0-9_-]*)(\\\\b|:)\",\n },\n ],\n \"eslint/class-methods-use-this\": \"off\",\n \"eslint/complexity\": [\"error\", { max: 30 }],\n \"eslint/id-length\": [\n \"error\",\n {\n checkGeneric: false,\n exceptions: [\"a\", \"b\", \"i\", \"j\", \"K\", \"T\", \"U\", \"x\"],\n },\n ],\n \"eslint/init-declarations\": \"off\",\n \"eslint/max-lines-per-function\": [\n \"error\",\n { max: 120, skipBlankLines: true, skipComments: true },\n ],\n \"eslint/max-params\": [\"error\", { max: 4 }],\n \"eslint/max-statements\": [\"error\", { max: 40 }],\n \"eslint/no-await-in-loop\": \"off\",\n \"eslint/no-continue\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"eslint/no-magic-numbers\": \"off\",\n \"eslint/no-plusplus\": \"off\",\n \"eslint/no-ternary\": \"off\",\n \"eslint/no-underscore-dangle\": [\"error\", { allow: [] }],\n \"eslint/no-use-before-define\": \"off\",\n \"eslint/no-warning-comments\": \"off\",\n \"eslint/require-unicode-regexp\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": [\"error\", { max: 30 }],\n \"import/no-default-export\": \"off\",\n \"import/no-named-default\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"jsdoc/require-param-type\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"jsdoc/require-returns-type\": \"off\",\n \"no-unused-vars\": [\n \"error\",\n {\n args: \"all\",\n argsIgnorePattern: \"^_\",\n caughtErrors: \"all\",\n caughtErrorsIgnorePattern: \"^_\",\n destructuredArrayIgnorePattern: \"^_\",\n },\n ],\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"promise/avoid-new\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/no-inferrable-types\": \"off\",\n \"typescript/no-unnecessary-condition\": \"off\",\n \"typescript/no-unnecessary-type-parameters\": \"off\",\n \"typescript/no-unsafe-type-assertion\": \"off\",\n \"typescript/no-useless-default-assignment\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/restrict-template-expressions\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/no-null\": \"off\",\n \"unicorn/no-lonely-if\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n },\n} satisfies OxlintConfig;\n\n/* ============================================================================================= */\n\nexport default base;\n","import base from \"./base.ts\";\n\nimport type { OxlintConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst eslintIdLength = base.rules[\"eslint/id-length\"];\neslintIdLength[1].exceptions = [...eslintIdLength[1].exceptions, \"h\", \"m\", \"p\", \"w\", \"y\", \"z\"];\n\nconst lib = {\n ...base,\n rules: {\n ...base.rules,\n \"eslint/id-length\": eslintIdLength,\n },\n} satisfies OxlintConfig;\n\n/* ============================================================================================= */\n\nexport default lib;\n","import base from \"./base.ts\";\n\nimport type { OxlintConfig } from \"./types.ts\";\n\n/* ============================================================================================= */\n\nconst next = {\n ...base,\n env: {\n ...base.env,\n browser: true,\n },\n jsPlugins: [\n {\n name: \"react-hooks-js\",\n specifier: \"eslint-plugin-react-hooks\",\n },\n ],\n plugins: [...base.plugins, \"jsx-a11y\", \"nextjs\", \"react\", \"react-perf\"],\n rules: {\n ...base.rules,\n \"eslint/no-undefined\": \"off\",\n \"import/no-unassigned-import\": [\"error\", { allow: [\"**/*.css\"] }],\n \"react/forbid-component-props\": [\"error\", { forbid: [\"style\"] }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\"jsx\", \"tsx\"] }],\n \"react/jsx-pascal-case\": [\"error\", { allowAllCaps: true }],\n \"react/jsx-props-no-spreading\": \"off\",\n \"react/jsx-max-depth\": [\"error\", { max: 6 }],\n \"react/no-multi-comp\": [\"error\", { ignoreStateless: true }],\n \"react/only-export-components\": [\n \"error\",\n {\n allowExportNames: [\n \"dynamicParams\",\n \"generateMetadata\",\n \"generateStaticParams\",\n \"metadata\",\n \"variants\",\n ],\n },\n ],\n \"react/react-in-jsx-scope\": \"off\",\n \"react-hooks-js/error-boundaries\": \"error\",\n \"react-hooks-js/config\": \"error\",\n \"react-hooks-js/globals\": \"error\",\n \"react-hooks-js/immutability\": \"error\",\n \"react-hooks-js/incompatible-library\": \"error\",\n \"react-hooks-js/preserve-manual-memoization\": \"error\",\n \"react-hooks-js/purity\": \"error\",\n \"react-hooks-js/refs\": \"error\",\n \"react-hooks-js/set-state-in-effect\": \"error\",\n \"react-hooks-js/set-state-in-render\": \"error\",\n \"react-hooks-js/static-components\": \"error\",\n \"react-hooks-js/unsupported-syntax\": \"error\",\n \"react-hooks-js/use-memo\": \"error\",\n \"react-perf/jsx-no-jsx-as-prop\": \"off\",\n \"react-perf/jsx-no-new-array-as-prop\": \"off\",\n \"react-perf/jsx-no-new-function-as-prop\": \"off\",\n \"react-perf/jsx-no-new-object-as-prop\": \"off\",\n },\n} satisfies OxlintConfig;\n\n/* ============================================================================================= */\n\nexport default next;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const base: {
|
|
2
|
+
arrowParens: "always";
|
|
3
|
+
bracketSpacing: true;
|
|
4
|
+
endOfLine: "lf";
|
|
5
|
+
ignorePatterns: never[];
|
|
6
|
+
insertFinalNewline: true;
|
|
7
|
+
jsdoc: {
|
|
8
|
+
addDefaultToDescription: true;
|
|
9
|
+
bracketSpacing: true;
|
|
10
|
+
capitalizeDescriptions: false;
|
|
11
|
+
commentLineStrategy: string;
|
|
12
|
+
descriptionTag: false;
|
|
13
|
+
descriptionWithDot: false;
|
|
14
|
+
keepUnparsableExampleIndent: true;
|
|
15
|
+
lineWrappingStyle: string;
|
|
16
|
+
preferCodeFences: true;
|
|
17
|
+
separateReturnsFromParam: true;
|
|
18
|
+
separateTagGroups: true;
|
|
19
|
+
};
|
|
20
|
+
objectWrap: "preserve";
|
|
21
|
+
printWidth: number;
|
|
22
|
+
proseWrap: "always";
|
|
23
|
+
quoteProps: "as-needed";
|
|
24
|
+
semi: true;
|
|
25
|
+
singleQuote: false;
|
|
26
|
+
sortImports: {
|
|
27
|
+
groups: (string | string[])[];
|
|
28
|
+
ignoreCase: true;
|
|
29
|
+
internalPattern: string[];
|
|
30
|
+
newlinesBetween: true;
|
|
31
|
+
order: "asc";
|
|
32
|
+
partitionByComment: true;
|
|
33
|
+
partitionByNewline: false;
|
|
34
|
+
sortSideEffects: false;
|
|
35
|
+
};
|
|
36
|
+
sortPackageJson: false;
|
|
37
|
+
tabWidth: number;
|
|
38
|
+
trailingComma: "all";
|
|
39
|
+
useTabs: false;
|
|
40
|
+
};
|
|
41
|
+
export default base;
|
|
42
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/configs/oxfmt/base.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDa,CAAC;AAIxB,eAAe,IAAI,CAAC"}
|