@adbayb/stack 0.0.0-next-5dd260c → 0.0.0-next.d8e717b
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 +4 -4
- package/bin/index.js +2 -4
- package/configs/{prettier → oxfmt}/README.md +6 -14
- package/configs/oxfmt/index.ts +41 -0
- package/configs/{eslint → oxlint}/README.md +4 -4
- package/configs/oxlint/index.ts +319 -0
- package/configs/typescript/index.json +1 -7
- package/dist/configs/oxfmt.d.ts +32 -0
- package/dist/configs/oxfmt.js +37 -0
- package/dist/configs/oxlint.d.ts +273 -0
- package/dist/configs/oxlint.js +325 -0
- package/dist/index.js +819 -779
- package/package.json +44 -51
- package/templates/multi-projects/.github/renovate.json +0 -3
- package/templates/multi-projects/.github/workflows/continuous_delivery.yml +8 -14
- package/templates/multi-projects/.github/workflows/conventional_commit.yml +1 -1
- package/templates/multi-projects/.github/workflows/dependency_changelog.yml +1 -1
- package/templates/multi-projects/.github/workflows/workflow.yml +4 -4
- package/templates/multi-projects/.gitignore.tmpl +45 -32
- package/templates/multi-projects/.vscode/extensions.json +1 -6
- package/templates/multi-projects/.vscode/settings.json +10 -26
- package/templates/multi-projects/libraries/{{projectName}}/{package.json.tmpl → package.json} +15 -17
- package/templates/multi-projects/libraries/{{projectName}}/src/{index.test.ts.tmpl → index.test.ts} +2 -0
- package/templates/multi-projects/oxfmt.config.ts +1 -0
- package/templates/multi-projects/oxlint.config.ts +1 -0
- package/templates/{single-project/package.json.tmpl → multi-projects/package.json} +11 -5
- package/templates/multi-projects/pnpm-workspace.yaml +21 -0
- package/templates/single-project/.github/renovate.json +0 -3
- package/templates/single-project/.github/workflows/continuous_delivery.yml +8 -14
- package/templates/single-project/.github/workflows/conventional_commit.yml +1 -1
- package/templates/single-project/.github/workflows/dependency_changelog.yml +1 -1
- package/templates/single-project/.github/workflows/workflow.yml +4 -4
- package/templates/single-project/.gitignore.tmpl +45 -32
- package/templates/single-project/.vscode/extensions.json +1 -6
- package/templates/single-project/.vscode/settings.json +10 -26
- package/templates/single-project/oxfmt.config.ts +1 -0
- package/templates/single-project/oxlint.config.ts +1 -0
- package/templates/{multi-projects/package.json.tmpl → single-project/package.json} +11 -5
- package/templates/single-project/pnpm-workspace.yaml +20 -0
- package/templates/single-project/{{projectName}}/{package.json.tmpl → package.json} +15 -17
- package/templates/single-project/{{projectName}}/src/{index.test.ts.tmpl → index.test.ts} +2 -0
- package/configs/eslint/constants.js +0 -37
- package/configs/eslint/helpers.js +0 -5
- package/configs/eslint/index.js +0 -30
- package/configs/eslint/presets/dependencies.js +0 -14
- package/configs/eslint/presets/eslint.js +0 -133
- package/configs/eslint/presets/import.js +0 -65
- package/configs/eslint/presets/jsdoc.js +0 -78
- package/configs/eslint/presets/markdown.js +0 -1
- package/configs/eslint/presets/node.js +0 -50
- package/configs/eslint/presets/prettier.js +0 -1
- package/configs/eslint/presets/react.js +0 -101
- package/configs/eslint/presets/sonar.js +0 -202
- package/configs/eslint/presets/stylistic.js +0 -79
- package/configs/eslint/presets/test.js +0 -87
- package/configs/eslint/presets/typescript.js +0 -198
- package/configs/eslint/presets/unicorn.js +0 -143
- package/configs/prettier/index.js +0 -25
- package/templates/multi-projects/.npmrc.tmpl +0 -8
- package/templates/multi-projects/.nvmrc.tmpl +0 -1
- package/templates/multi-projects/eslint.config.js.tmpl +0 -1
- package/templates/multi-projects/pnpm-workspace.yaml.tmpl +0 -5
- package/templates/single-project/.npmrc.tmpl +0 -8
- package/templates/single-project/.nvmrc.tmpl +0 -1
- package/templates/single-project/eslint.config.js.tmpl +0 -1
- package/templates/single-project/pnpm-workspace.yaml.tmpl +0 -4
- /package/templates/multi-projects/.changeset/{config.json.tmpl → config.json} +0 -0
- /package/templates/multi-projects/.changeset/{welcome.md.tmpl → welcome.md} +0 -0
- /package/templates/multi-projects/.github/{PULL_REQUEST_TEMPLATE.md.tmpl → PULL_REQUEST_TEMPLATE.md} +0 -0
- /package/templates/multi-projects/{CONTRIBUTING.md.tmpl → CONTRIBUTING.md} +0 -0
- /package/templates/multi-projects/{LICENSE.tmpl → LICENSE} +0 -0
- /package/templates/multi-projects/examples/default/{package.json.tmpl → package.json} +0 -0
- /package/templates/multi-projects/examples/default/src/{index.ts.tmpl → index.ts} +0 -0
- /package/templates/multi-projects/libraries/{{projectName}}/{README.md.tmpl → README.md} +0 -0
- /package/templates/single-project/.changeset/{config.json.tmpl → config.json} +0 -0
- /package/templates/single-project/.changeset/{welcome.md.tmpl → welcome.md} +0 -0
- /package/templates/single-project/.github/{PULL_REQUEST_TEMPLATE.md.tmpl → PULL_REQUEST_TEMPLATE.md} +0 -0
- /package/templates/single-project/{CONTRIBUTING.md.tmpl → CONTRIBUTING.md} +0 -0
- /package/templates/single-project/{LICENSE.tmpl → LICENSE} +0 -0
- /package/templates/single-project/examples/default/{package.json.tmpl → package.json} +0 -0
- /package/templates/single-project/examples/default/src/{index.ts.tmpl → index.ts} +0 -0
- /package/templates/single-project/{{projectName}}/{README.md.tmpl → README.md} +0 -0
|
@@ -5,7 +5,6 @@ npm-debug.log*
|
|
|
5
5
|
yarn-debug.log*
|
|
6
6
|
yarn-error.log*
|
|
7
7
|
lerna-debug.log*
|
|
8
|
-
.pnpm-debug.log*
|
|
9
8
|
|
|
10
9
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
11
10
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
@@ -57,12 +56,6 @@ web_modules/
|
|
|
57
56
|
# Optional stylelint cache
|
|
58
57
|
.stylelintcache
|
|
59
58
|
|
|
60
|
-
# Microbundle cache
|
|
61
|
-
.rpt2_cache/
|
|
62
|
-
.rts2_cache_cjs/
|
|
63
|
-
.rts2_cache_es/
|
|
64
|
-
.rts2_cache_umd/
|
|
65
|
-
|
|
66
59
|
# Optional REPL history
|
|
67
60
|
.node_repl_history
|
|
68
61
|
|
|
@@ -74,24 +67,42 @@ web_modules/
|
|
|
74
67
|
|
|
75
68
|
# dotenv environment variable files
|
|
76
69
|
.env
|
|
77
|
-
.env
|
|
78
|
-
|
|
79
|
-
.env.production.local
|
|
80
|
-
.env.local
|
|
70
|
+
.env.*
|
|
71
|
+
!.env.example
|
|
81
72
|
|
|
82
73
|
# parcel-bundler cache (https://parceljs.org/)
|
|
83
74
|
.cache
|
|
84
75
|
.parcel-cache
|
|
85
76
|
|
|
77
|
+
# Next.js build output
|
|
78
|
+
.next
|
|
79
|
+
out
|
|
80
|
+
|
|
81
|
+
# Nuxt.js build / generate output
|
|
82
|
+
.nuxt
|
|
83
|
+
dist
|
|
84
|
+
.output
|
|
85
|
+
|
|
86
86
|
# Gatsby files
|
|
87
87
|
.cache/
|
|
88
88
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
89
89
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
90
90
|
# public
|
|
91
91
|
|
|
92
|
-
# vuepress
|
|
92
|
+
# vuepress build output
|
|
93
|
+
.vuepress/dist
|
|
94
|
+
|
|
95
|
+
# vuepress v2.x temp directory
|
|
93
96
|
.temp
|
|
94
|
-
|
|
97
|
+
|
|
98
|
+
# Sveltekit cache directory
|
|
99
|
+
.svelte-kit/
|
|
100
|
+
|
|
101
|
+
# vitepress build output
|
|
102
|
+
**/.vitepress/dist
|
|
103
|
+
|
|
104
|
+
# vitepress cache directory
|
|
105
|
+
**/.vitepress/cache
|
|
95
106
|
|
|
96
107
|
# Docusaurus cache and generated files
|
|
97
108
|
.docusaurus
|
|
@@ -105,31 +116,33 @@ web_modules/
|
|
|
105
116
|
# DynamoDB Local files
|
|
106
117
|
.dynamodb/
|
|
107
118
|
|
|
119
|
+
# Firebase cache directory
|
|
120
|
+
.firebase/
|
|
121
|
+
|
|
108
122
|
# TernJS port file
|
|
109
123
|
.tern-port
|
|
110
124
|
|
|
111
125
|
# Stores VSCode versions used for testing VSCode extensions
|
|
112
126
|
.vscode-test
|
|
113
127
|
|
|
114
|
-
#
|
|
115
|
-
.
|
|
116
|
-
.yarn/unplugged
|
|
117
|
-
.yarn/build-state.yml
|
|
118
|
-
.yarn/install-state.gz
|
|
119
|
-
.pnp.*
|
|
120
|
-
|
|
121
|
-
# Vitest
|
|
122
|
-
tsconfig.vitest-temp.json
|
|
123
|
-
|
|
124
|
-
# Build output
|
|
125
|
-
.expo
|
|
126
|
-
web-build
|
|
127
|
-
expo-env.d.ts
|
|
128
|
-
.next
|
|
129
|
-
.nuxt
|
|
130
|
-
out
|
|
131
|
-
dist
|
|
128
|
+
# pnpm
|
|
129
|
+
.pnpm-store
|
|
132
130
|
|
|
133
|
-
#
|
|
131
|
+
# yarn v3
|
|
132
|
+
.pnp.*
|
|
133
|
+
.yarn/*
|
|
134
|
+
!.yarn/patches
|
|
135
|
+
!.yarn/plugins
|
|
136
|
+
!.yarn/releases
|
|
137
|
+
!.yarn/sdks
|
|
138
|
+
!.yarn/versions
|
|
139
|
+
|
|
140
|
+
# Vite files
|
|
141
|
+
vite.config.js.timestamp-*
|
|
142
|
+
vite.config.ts.timestamp-*
|
|
143
|
+
.vite/
|
|
144
|
+
|
|
145
|
+
# Custom
|
|
134
146
|
.DS_Store
|
|
135
147
|
.turbo
|
|
148
|
+
test-results
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
"javascriptreact",
|
|
5
|
-
"typescript",
|
|
6
|
-
"typescriptreact",
|
|
7
|
-
"markdown",
|
|
8
|
-
"mdx",
|
|
9
|
-
"astro"
|
|
10
|
-
],
|
|
2
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
3
|
+
"editor.formatOnSave": true,
|
|
11
4
|
"editor.codeActionsOnSave": {
|
|
12
|
-
"source.
|
|
13
|
-
"source.fixAll.
|
|
14
|
-
"source.
|
|
5
|
+
"source.format.oxc": "always",
|
|
6
|
+
"source.fixAll.oxc": "always",
|
|
7
|
+
"source.fixAll.ts": "always",
|
|
8
|
+
"source.addMissingImports.ts": "always",
|
|
15
9
|
"source.organizeImports": "never",
|
|
16
|
-
"source.organizeLinkDefinitions": "
|
|
10
|
+
"source.organizeLinkDefinitions": "always",
|
|
17
11
|
"source.removeUnused.ts": "never",
|
|
18
12
|
"source.removeUnusedImports": "never",
|
|
19
13
|
"source.sortImports": "never"
|
|
20
14
|
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"grammarly.selectors": [
|
|
25
|
-
{
|
|
26
|
-
"language": "mdx",
|
|
27
|
-
"scheme": "file"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"language": "md",
|
|
31
|
-
"scheme": "file"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
15
|
+
"js/ts.tsdk.path": "node_modules/typescript/lib",
|
|
16
|
+
"js/ts.tsdk.promptToUseWorkspaceVersion": true,
|
|
17
|
+
"workbench.editor.labelFormat": "short"
|
|
34
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@adbayb/stack/oxfmt";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@adbayb/stack/oxlint";
|
|
@@ -16,10 +16,16 @@
|
|
|
16
16
|
"test": "stack test",
|
|
17
17
|
"watch": "stack watch"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
"devEngines": {
|
|
20
|
+
"packageManager": {
|
|
21
|
+
"name": "pnpm",
|
|
22
|
+
"version": "{{pnpmVersion}}",
|
|
23
|
+
"onFail": "download"
|
|
24
|
+
},
|
|
25
|
+
"runtime": {
|
|
26
|
+
"name": "node",
|
|
27
|
+
"version": "{{nodeVersion}}",
|
|
28
|
+
"onFail": "error"
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
packages:
|
|
2
|
+
- "examples/*"
|
|
3
|
+
- "tools/*"
|
|
4
|
+
- "{{projectName}}"
|
|
5
|
+
allowBuilds:
|
|
6
|
+
esbuild: true
|
|
7
|
+
saveExact: true
|
|
8
|
+
verifyDepsBeforeRun: "warn"
|
|
9
|
+
update:
|
|
10
|
+
githubActions: true
|
|
11
|
+
minimumReleaseAgeExclude:
|
|
12
|
+
- "@adbayb/*"
|
|
13
|
+
publicHoistPattern:
|
|
14
|
+
- "*changesets*"
|
|
15
|
+
- "*commitlint*"
|
|
16
|
+
- "*oxfmt*"
|
|
17
|
+
- "*oxlint*"
|
|
18
|
+
- "*turbo*"
|
|
19
|
+
- "*typescript*"
|
|
20
|
+
- "*types*"
|
|
@@ -4,27 +4,29 @@
|
|
|
4
4
|
"description": "{{projectDescription}}",
|
|
5
5
|
"homepage": "https://github.com/{{repoId}}/tree/main/{{projectName}}#readme",
|
|
6
6
|
"bugs": "https://github.com/{{repoId}}/issues",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Ayoub Adib <adbayb@gmail.com> (https://twitter.com/adbayb)",
|
|
7
9
|
"repository": {
|
|
8
10
|
"type": "git",
|
|
9
11
|
"url": "{{projectUrl}}",
|
|
10
12
|
"directory": "{{projectName}}"
|
|
11
13
|
},
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"author": "Ayoub Adib <adbayb@gmail.com> (https://twitter.com/adbayb)",
|
|
14
|
-
"sideEffects": false,
|
|
15
|
-
"type": "module",
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"source": "./src/index.ts",
|
|
19
|
-
"types": "./dist/index.d.ts",
|
|
20
|
-
"require": "./dist/index.cjs",
|
|
21
|
-
"import": "./dist/index.mjs",
|
|
22
|
-
"default": "./dist/index.mjs"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
14
|
"files": [
|
|
26
15
|
"dist"
|
|
27
16
|
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"exports": {
|
|
20
|
+
"source": "./src/index.ts",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"require": "./dist/index.cjs",
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"default": "./dist/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org"
|
|
29
|
+
},
|
|
28
30
|
"scripts": {
|
|
29
31
|
"build": "pnpm clean && quickbundle build",
|
|
30
32
|
"clean": "rm -rf dist",
|
|
@@ -32,9 +34,5 @@
|
|
|
32
34
|
"start": "pnpm watch",
|
|
33
35
|
"test": "vitest --passWithNoTests --typecheck --reporter=verbose",
|
|
34
36
|
"watch": "quickbundle watch"
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public",
|
|
38
|
-
"registry": "https://registry.npmjs.org"
|
|
39
37
|
}
|
|
40
38
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const JAVASCRIPT_EXTENSIONS = ["js", "jsx", "cjs", "mjs", "mjsx"];
|
|
2
|
-
const TYPESCRIPT_EXTENSIONS = ["ts", "tsx", "cts", "mts", "mtsx"];
|
|
3
|
-
|
|
4
|
-
const JAVASCRIPT_LIKE_EXTENSIONS = [
|
|
5
|
-
...JAVASCRIPT_EXTENSIONS,
|
|
6
|
-
...TYPESCRIPT_EXTENSIONS,
|
|
7
|
-
];
|
|
8
|
-
|
|
9
|
-
const JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING =
|
|
10
|
-
JAVASCRIPT_LIKE_EXTENSIONS.join(",");
|
|
11
|
-
|
|
12
|
-
export const JAVASCRIPT_FILES = [`**/*.{${JAVASCRIPT_EXTENSIONS.join(",")}}`];
|
|
13
|
-
|
|
14
|
-
export const TYPESCRIPT_FILES = [`**/*.{${TYPESCRIPT_EXTENSIONS.join(",")}}`];
|
|
15
|
-
|
|
16
|
-
export const JAVASCRIPT_LIKE_FILES = [
|
|
17
|
-
`**/*.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
export const TEST_LIKE_FILES = [
|
|
21
|
-
`**/{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
22
|
-
`**/*.{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
export const RELAXED_LIKE_FILES = [
|
|
26
|
-
...TEST_LIKE_FILES,
|
|
27
|
-
"**/?(.)config?(s)/**",
|
|
28
|
-
"**/examples/**",
|
|
29
|
-
"**/scripts/**",
|
|
30
|
-
"**/tools/**",
|
|
31
|
-
`**/config?(s).{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
32
|
-
`**/*.config?(s).{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
33
|
-
`**/stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
34
|
-
`**/*.stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
export const CWD = process.cwd();
|
package/configs/eslint/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createConfig } from "./helpers.js";
|
|
2
|
-
import { config as dependenciesConfig } from "./presets/dependencies.js";
|
|
3
|
-
import { config as eslintConfig } from "./presets/eslint.js";
|
|
4
|
-
import { config as importConfig } from "./presets/import.js";
|
|
5
|
-
import { config as jsdocConfig } from "./presets/jsdoc.js";
|
|
6
|
-
import { config as markdownConfig } from "./presets/markdown.js";
|
|
7
|
-
import { config as nodeConfig } from "./presets/node.js";
|
|
8
|
-
import { prettierConfig } from "./presets/prettier.js";
|
|
9
|
-
import { config as reactConfig } from "./presets/react.js";
|
|
10
|
-
import { config as sonarConfig } from "./presets/sonar.js";
|
|
11
|
-
import { config as stylisticConfig } from "./presets/stylistic.js";
|
|
12
|
-
import { config as testConfig } from "./presets/test.js";
|
|
13
|
-
import { config as typescriptConfig } from "./presets/typescript.js";
|
|
14
|
-
import { config as unicornConfig } from "./presets/unicorn.js";
|
|
15
|
-
|
|
16
|
-
export default createConfig(
|
|
17
|
-
eslintConfig,
|
|
18
|
-
typescriptConfig,
|
|
19
|
-
prettierConfig,
|
|
20
|
-
importConfig,
|
|
21
|
-
jsdocConfig,
|
|
22
|
-
markdownConfig,
|
|
23
|
-
nodeConfig,
|
|
24
|
-
reactConfig,
|
|
25
|
-
sonarConfig,
|
|
26
|
-
stylisticConfig,
|
|
27
|
-
testConfig,
|
|
28
|
-
unicornConfig,
|
|
29
|
-
dependenciesConfig,
|
|
30
|
-
);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import dependPlugin from "eslint-plugin-depend";
|
|
2
|
-
|
|
3
|
-
import { JAVASCRIPT_LIKE_FILES } from "../constants.js";
|
|
4
|
-
import { createConfig } from "../helpers.js";
|
|
5
|
-
|
|
6
|
-
export const config = createConfig({
|
|
7
|
-
files: JAVASCRIPT_LIKE_FILES,
|
|
8
|
-
plugins: {
|
|
9
|
-
depend: dependPlugin,
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
"depend/ban-dependencies": "error",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { includeIgnoreFile } from "@eslint/compat";
|
|
2
|
-
import globals from "globals";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
|
|
5
|
-
import { CWD, JAVASCRIPT_FILES, JAVASCRIPT_LIKE_FILES } from "../constants.js";
|
|
6
|
-
import { createConfig } from "../helpers.js";
|
|
7
|
-
|
|
8
|
-
export const config = createConfig(
|
|
9
|
-
{
|
|
10
|
-
languageOptions: {
|
|
11
|
-
ecmaVersion: "latest",
|
|
12
|
-
globals: {
|
|
13
|
-
...globals.browser,
|
|
14
|
-
...globals.node,
|
|
15
|
-
...globals.worker,
|
|
16
|
-
},
|
|
17
|
-
parserOptions: {
|
|
18
|
-
ecmaFeatures: {
|
|
19
|
-
jsx: true,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
sourceType: "module",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
includeIgnoreFile(resolve(CWD, ".gitignore")),
|
|
26
|
-
{
|
|
27
|
-
/*
|
|
28
|
-
* Specific ESLint rules for javascript-only files (as they're already handled for TypeScript files by the transpiler):
|
|
29
|
-
* This rule list is taken from https://typescript-eslint.io/users/configs/#recommended
|
|
30
|
-
*/
|
|
31
|
-
files: JAVASCRIPT_FILES,
|
|
32
|
-
rules: {
|
|
33
|
-
"constructor-super": "error", // ts(2335) & ts(2377)
|
|
34
|
-
"getter-return": "error", // ts(2378)
|
|
35
|
-
"no-const-assign": "error", // ts(2588)
|
|
36
|
-
"no-dupe-args": "error", // ts(2300)
|
|
37
|
-
"no-dupe-class-members": "error", // ts(2393) & ts(2300)
|
|
38
|
-
"no-dupe-keys": "error", // ts(1117)
|
|
39
|
-
"no-func-assign": "error", // ts(2630)
|
|
40
|
-
"no-import-assign": "error", // ts(2632) & ts(2540)
|
|
41
|
-
"no-new-native-nonconstructor": "error", // ts(7009)
|
|
42
|
-
"no-obj-calls": "error", // ts(2349)
|
|
43
|
-
"no-redeclare": "error", // ts(2451)
|
|
44
|
-
"no-setter-return": "error", // ts(2408)
|
|
45
|
-
"no-this-before-super": "error", // ts(2376) & ts(17009)
|
|
46
|
-
"no-undef": "error", // ts(2304) & ts(2552)
|
|
47
|
-
"no-unreachable": "error", // ts(7027)
|
|
48
|
-
"no-unsafe-negation": "error", // ts(2365) & ts(2322) & ts(2358)
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
// ESLint rules for JavaScript + TypeScript files:
|
|
53
|
-
files: JAVASCRIPT_LIKE_FILES,
|
|
54
|
-
rules: {
|
|
55
|
-
"eqeqeq": "error",
|
|
56
|
-
"for-direction": "error",
|
|
57
|
-
"max-params": ["error", { max: 4 }],
|
|
58
|
-
"no-alert": "error",
|
|
59
|
-
"no-async-promise-executor": "error",
|
|
60
|
-
"no-case-declarations": "error",
|
|
61
|
-
"no-class-assign": "error",
|
|
62
|
-
"no-compare-neg-zero": "error",
|
|
63
|
-
"no-cond-assign": "error",
|
|
64
|
-
"no-constant-binary-expression": "error",
|
|
65
|
-
"no-constant-condition": "error",
|
|
66
|
-
"no-control-regex": "error",
|
|
67
|
-
"no-debugger": "error",
|
|
68
|
-
"no-delete-var": "error",
|
|
69
|
-
"no-dupe-else-if": "error",
|
|
70
|
-
"no-duplicate-case": "error",
|
|
71
|
-
"no-empty": "error",
|
|
72
|
-
"no-empty-character-class": "error",
|
|
73
|
-
"no-empty-pattern": "error",
|
|
74
|
-
"no-empty-static-block": "error",
|
|
75
|
-
"no-ex-assign": "error",
|
|
76
|
-
"no-extend-native": "error",
|
|
77
|
-
"no-extra-boolean-cast": "error",
|
|
78
|
-
"no-fallthrough": "error",
|
|
79
|
-
"no-global-assign": "error",
|
|
80
|
-
"no-invalid-regexp": "error",
|
|
81
|
-
"no-irregular-whitespace": "error",
|
|
82
|
-
"no-lonely-if": "error",
|
|
83
|
-
"no-loss-of-precision": "error",
|
|
84
|
-
"no-misleading-character-class": "error",
|
|
85
|
-
"no-nonoctal-decimal-escape": "error",
|
|
86
|
-
"no-octal": "error",
|
|
87
|
-
"no-prototype-builtins": "error",
|
|
88
|
-
"no-regex-spaces": "error",
|
|
89
|
-
"no-restricted-syntax": [
|
|
90
|
-
"error",
|
|
91
|
-
/*
|
|
92
|
-
* https://medium.com/@hbarcelos/why-i-banned-null-from-my-js-code-and-why-you-should-too-13df90323cfa
|
|
93
|
-
* https://www.youtube.com/watch?v=PSGEjv3Tqo0&t=561s
|
|
94
|
-
*/
|
|
95
|
-
{
|
|
96
|
-
message: "Use `undefined` instead of `null`.",
|
|
97
|
-
selector: "VariableDeclarator > Literal[raw='null']",
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
message: "Use `undefined` instead of `null`.",
|
|
101
|
-
selector: "AssignmentExpression > Literal[raw='null']",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
"no-self-assign": "error",
|
|
105
|
-
"no-shadow-restricted-names": "error",
|
|
106
|
-
"no-sparse-arrays": "error",
|
|
107
|
-
"no-template-curly-in-string": "error",
|
|
108
|
-
"no-unexpected-multiline": "error",
|
|
109
|
-
"no-unsafe-finally": "error",
|
|
110
|
-
"no-unsafe-optional-chaining": "error",
|
|
111
|
-
"no-unused-labels": "error",
|
|
112
|
-
"no-unused-private-class-members": "error",
|
|
113
|
-
"no-useless-backreference": "error",
|
|
114
|
-
"no-useless-call": "error",
|
|
115
|
-
"no-useless-catch": "error",
|
|
116
|
-
"no-useless-escape": "error",
|
|
117
|
-
"no-var": "error",
|
|
118
|
-
"no-with": "error",
|
|
119
|
-
"object-shorthand": ["error", "always"],
|
|
120
|
-
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
121
|
-
"prefer-const": "error",
|
|
122
|
-
"prefer-object-spread": "error",
|
|
123
|
-
"prefer-rest-params": "error",
|
|
124
|
-
"prefer-spread": "error",
|
|
125
|
-
"prefer-template": "error",
|
|
126
|
-
"require-yield": "error",
|
|
127
|
-
"sort-imports": ["error", { ignoreDeclarationSort: true }],
|
|
128
|
-
"sort-vars": "error",
|
|
129
|
-
"use-isnan": "error",
|
|
130
|
-
"valid-typeof": "error",
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
);
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import importPlugin from "eslint-plugin-import-x";
|
|
2
|
-
|
|
3
|
-
import { JAVASCRIPT_LIKE_FILES, RELAXED_LIKE_FILES } from "../constants.js";
|
|
4
|
-
import { createConfig } from "../helpers.js";
|
|
5
|
-
|
|
6
|
-
export const config = createConfig(
|
|
7
|
-
importPlugin.flatConfigs.typescript,
|
|
8
|
-
{
|
|
9
|
-
files: JAVASCRIPT_LIKE_FILES,
|
|
10
|
-
rules: {
|
|
11
|
-
"import-x/consistent-type-specifier-style": [
|
|
12
|
-
"error",
|
|
13
|
-
"prefer-top-level",
|
|
14
|
-
],
|
|
15
|
-
"import-x/export": "error",
|
|
16
|
-
"import-x/first": "error",
|
|
17
|
-
"import-x/newline-after-import": "error",
|
|
18
|
-
"import-x/no-absolute-path": "error",
|
|
19
|
-
"import-x/no-amd": "error",
|
|
20
|
-
"import-x/no-anonymous-default-export": "error",
|
|
21
|
-
"import-x/no-cycle": "error",
|
|
22
|
-
"import-x/no-default-export": "error",
|
|
23
|
-
"import-x/no-duplicates": "error",
|
|
24
|
-
"import-x/no-empty-named-blocks": "error",
|
|
25
|
-
"import-x/no-extraneous-dependencies": "error",
|
|
26
|
-
"import-x/no-import-module-exports": "error",
|
|
27
|
-
"import-x/no-mutable-exports": "error",
|
|
28
|
-
"import-x/no-named-default": "error",
|
|
29
|
-
"import-x/no-namespace": "error",
|
|
30
|
-
"import-x/no-relative-packages": "error",
|
|
31
|
-
"import-x/no-self-import": "error",
|
|
32
|
-
"import-x/no-unassigned-import": "error",
|
|
33
|
-
"import-x/no-unused-modules": [
|
|
34
|
-
"error",
|
|
35
|
-
{
|
|
36
|
-
missingExports: true,
|
|
37
|
-
suppressMissingFileEnumeratorAPIWarning: true,
|
|
38
|
-
unusedExports: true,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
"import-x/no-useless-path-segments": [
|
|
42
|
-
"error",
|
|
43
|
-
{
|
|
44
|
-
commonjs: true,
|
|
45
|
-
noUselessIndex: true,
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
"import-x/no-webpack-loader-syntax": "error",
|
|
49
|
-
"import-x/unambiguous": "error",
|
|
50
|
-
},
|
|
51
|
-
settings: {
|
|
52
|
-
"import-x/resolver": {
|
|
53
|
-
node: true,
|
|
54
|
-
typescript: true,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
files: RELAXED_LIKE_FILES,
|
|
60
|
-
rules: {
|
|
61
|
-
"import-x/no-anonymous-default-export": "off",
|
|
62
|
-
"import-x/no-default-export": "off",
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
);
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import jsdocPlugin from "eslint-plugin-jsdoc";
|
|
2
|
-
|
|
3
|
-
import { JAVASCRIPT_LIKE_FILES } from "../constants.js";
|
|
4
|
-
import { createConfig } from "../helpers.js";
|
|
5
|
-
|
|
6
|
-
export const config = createConfig({
|
|
7
|
-
files: JAVASCRIPT_LIKE_FILES,
|
|
8
|
-
plugins: {
|
|
9
|
-
jsdoc: jsdocPlugin,
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
"jsdoc/check-access": "error",
|
|
13
|
-
"jsdoc/check-alignment": "error",
|
|
14
|
-
"jsdoc/check-examples": "off", // To enable once ESLint >= 8.x is supported
|
|
15
|
-
"jsdoc/check-indentation": "error",
|
|
16
|
-
"jsdoc/check-line-alignment": "error",
|
|
17
|
-
"jsdoc/check-param-names": "error",
|
|
18
|
-
"jsdoc/check-property-names": "error",
|
|
19
|
-
"jsdoc/check-syntax": "error",
|
|
20
|
-
"jsdoc/check-tag-names": "error",
|
|
21
|
-
"jsdoc/check-types": "error",
|
|
22
|
-
"jsdoc/check-values": "error",
|
|
23
|
-
"jsdoc/empty-tags": "error",
|
|
24
|
-
"jsdoc/implements-on-classes": "error",
|
|
25
|
-
"jsdoc/multiline-blocks": "error",
|
|
26
|
-
"jsdoc/no-bad-blocks": "error",
|
|
27
|
-
"jsdoc/no-blank-block-descriptions": "error",
|
|
28
|
-
"jsdoc/no-blank-blocks": "error",
|
|
29
|
-
"jsdoc/no-defaults": "error",
|
|
30
|
-
"jsdoc/no-multi-asterisks": "error",
|
|
31
|
-
"jsdoc/no-types": "error",
|
|
32
|
-
"jsdoc/require-asterisk-prefix": "error",
|
|
33
|
-
"jsdoc/require-description": "error",
|
|
34
|
-
"jsdoc/require-description-complete-sentence": "error",
|
|
35
|
-
"jsdoc/require-example": "error",
|
|
36
|
-
"jsdoc/require-hyphen-before-param-description": "error",
|
|
37
|
-
"jsdoc/require-jsdoc": [
|
|
38
|
-
// To enable once the rule can be configured to require JSDoc for exported functions at package level (only at module level right now)
|
|
39
|
-
"off",
|
|
40
|
-
{
|
|
41
|
-
contexts: [
|
|
42
|
-
"TSTypeAliasDeclaration",
|
|
43
|
-
"TSInterfaceDeclaration",
|
|
44
|
-
"TSMethodSignature",
|
|
45
|
-
"TSPropertySignature",
|
|
46
|
-
],
|
|
47
|
-
publicOnly: {
|
|
48
|
-
ancestorsOnly: true,
|
|
49
|
-
cjs: true,
|
|
50
|
-
esm: true,
|
|
51
|
-
},
|
|
52
|
-
require: {
|
|
53
|
-
ArrowFunctionExpression: true,
|
|
54
|
-
ClassDeclaration: true,
|
|
55
|
-
ClassExpression: true,
|
|
56
|
-
FunctionDeclaration: true,
|
|
57
|
-
FunctionExpression: true,
|
|
58
|
-
MethodDefinition: true,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
"jsdoc/require-param": "error",
|
|
63
|
-
"jsdoc/require-param-description": "error",
|
|
64
|
-
"jsdoc/require-param-name": "error",
|
|
65
|
-
"jsdoc/require-property": "error",
|
|
66
|
-
"jsdoc/require-property-description": "error",
|
|
67
|
-
"jsdoc/require-property-name": "error",
|
|
68
|
-
"jsdoc/require-returns": "error",
|
|
69
|
-
"jsdoc/require-returns-check": "error",
|
|
70
|
-
"jsdoc/require-returns-description": "error",
|
|
71
|
-
"jsdoc/require-throws": "error",
|
|
72
|
-
"jsdoc/require-yields": "error",
|
|
73
|
-
"jsdoc/require-yields-check": "error",
|
|
74
|
-
"jsdoc/sort-tags": "error",
|
|
75
|
-
"jsdoc/tag-lines": "error",
|
|
76
|
-
"jsdoc/valid-types": "error",
|
|
77
|
-
},
|
|
78
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { flat as config } from "eslint-plugin-mdx";
|