@st1ggy/linter-config 8.0.0 → 10.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 +94 -34
- package/data/linter-config-inventory.json +451 -216
- package/data/oxlint-config-inventory.json +1075 -1074
- package/data/oxlint-rule-map.json +5329 -2075
- package/data/oxlint-source-inventory.json +8175 -5661
- package/docs/OXLINT_RULE_MAPPING.md +213 -105
- package/docs/RULE_MAPPING.md +2 -2
- package/package.json +110 -19
- package/scripts/README.md +9 -6
- package/scripts/init-angular-ox.sh +4 -0
- package/scripts/init-nuxt-ox.sh +4 -0
- package/scripts/init-vue-ox.sh +4 -0
- package/scripts/linter-init-core.mjs +32 -15
- package/scripts/linter-init.mjs +4 -2
- package/src/eslint/configs/config.common.js +4 -1
- package/src/eslint/configs/config.import.js +1 -1
- package/src/eslint/configs/config.prettier.js +1 -1
- package/src/eslint/configs/config.react.js +19 -26
- package/src/eslint/configs/config.solid.js +1 -1
- package/src/eslint/configs/config.sonarjs.js +1 -1
- package/src/eslint/configs/config.typescript.js +6 -0
- package/src/eslint/configs/config.unicorn.js +8 -19
- package/src/eslint/configs/import-plugin.js +48 -0
- package/src/eslint/configs/svelte-stack.js +5 -12
- package/src/eslint/eslint.config.angular-ox.js +26 -0
- package/src/eslint/eslint.config.astro-ox.js +3 -0
- package/src/eslint/eslint.config.nuxt-ox.js +4 -0
- package/src/eslint/eslint.config.svelte-ox.js +4 -0
- package/src/eslint/eslint.config.vue-ox.js +17 -0
- package/src/eslint/ox-supplement.d.ts +39 -0
- package/src/oxfmt/index.d.ts +24 -0
- package/src/oxfmt/oxfmt.config.angular.js +3 -0
- package/src/oxfmt/oxfmt.config.astro.js +3 -0
- package/src/oxfmt/oxfmt.config.common.js +9 -1
- package/src/oxfmt/oxfmt.config.svelte.js +3 -0
- package/src/oxlint/configs/config.astro.js +134 -176
- package/src/oxlint/configs/config.common.js +107 -151
- package/src/oxlint/configs/config.next.js +365 -300
- package/src/oxlint/configs/config.react.js +365 -300
- package/src/oxlint/configs/config.solid.js +157 -223
- package/src/oxlint/configs/config.svelte.js +121 -190
- package/src/oxlint/create-config.js +1 -1
- package/src/oxlint/framework-rules.js +79 -0
- package/src/oxlint/index.d.ts +24 -0
- package/src/oxlint/oxlint.config.angular.js +14 -0
- package/src/oxlint/oxlint.config.nuxt.js +24 -0
- package/src/oxlint/oxlint.config.vue.js +8 -0
- package/src/oxlint/plugins/angular.js +1 -0
- package/src/oxlint/plugins/import-x.js +1 -1
- package/src/oxlint/plugins/nuxt.js +1 -0
- package/src/oxlint/plugins/react.js +1 -1
- package/src/oxlint/stacks.js +22 -8
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Native script rules shared with eslint-plugin-vue's flat/recommended preset.
|
|
2
|
+
// Template-only rules remain in the companion ESLint preset.
|
|
3
|
+
const vueErrors = [
|
|
4
|
+
'no-arrow-functions-in-watch',
|
|
5
|
+
'no-async-in-computed-properties',
|
|
6
|
+
'no-computed-properties-in-data',
|
|
7
|
+
'no-deprecated-data-object-declaration',
|
|
8
|
+
'no-deprecated-delete-set',
|
|
9
|
+
'no-deprecated-destroyed-lifecycle',
|
|
10
|
+
'no-deprecated-events-api',
|
|
11
|
+
'no-deprecated-model-definition',
|
|
12
|
+
'no-deprecated-props-default-this',
|
|
13
|
+
'no-deprecated-vue-config-keycodes',
|
|
14
|
+
'no-dupe-keys',
|
|
15
|
+
'no-export-in-script-setup',
|
|
16
|
+
'no-expose-after-await',
|
|
17
|
+
'no-lifecycle-after-await',
|
|
18
|
+
'no-reserved-component-names',
|
|
19
|
+
'no-reserved-keys',
|
|
20
|
+
'no-reserved-props',
|
|
21
|
+
'no-shared-component-data',
|
|
22
|
+
'no-side-effects-in-computed-properties',
|
|
23
|
+
'no-watch-after-await',
|
|
24
|
+
'prefer-import-from-vue',
|
|
25
|
+
'require-prop-type-constructor',
|
|
26
|
+
'require-render-return',
|
|
27
|
+
'require-slots-as-functions',
|
|
28
|
+
'return-in-computed-property',
|
|
29
|
+
'return-in-emits-validator',
|
|
30
|
+
'valid-define-emits',
|
|
31
|
+
'valid-define-options',
|
|
32
|
+
'valid-define-props',
|
|
33
|
+
'valid-next-tick',
|
|
34
|
+
]
|
|
35
|
+
const vueWarnings = [
|
|
36
|
+
'component-definition-name-casing',
|
|
37
|
+
'prop-name-casing',
|
|
38
|
+
'require-default-prop',
|
|
39
|
+
'require-prop-types',
|
|
40
|
+
'no-multiple-slot-args',
|
|
41
|
+
'no-required-prop-with-default',
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
export const vueRules = Object.fromEntries([
|
|
45
|
+
...vueErrors.map((name) => [`vue/${name}`, 'error']),
|
|
46
|
+
...vueWarnings.map((name) => [`vue/${name}`, 'warn']),
|
|
47
|
+
])
|
|
48
|
+
|
|
49
|
+
export const nuxtRules = {
|
|
50
|
+
'nuxt/prefer-import-meta': 'error',
|
|
51
|
+
'nuxt/nuxt-config-keys-order': 'warn',
|
|
52
|
+
'nuxt/no-nuxt-config-test-key': 'error',
|
|
53
|
+
'nuxt/no-page-meta-runtime-values': 'error',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const angularRules = Object.fromEntries(
|
|
57
|
+
[
|
|
58
|
+
'contextual-lifecycle',
|
|
59
|
+
'no-empty-lifecycle-method',
|
|
60
|
+
'no-input-rename',
|
|
61
|
+
'no-inputs-metadata-property',
|
|
62
|
+
'no-output-native',
|
|
63
|
+
'no-output-on-prefix',
|
|
64
|
+
'no-output-rename',
|
|
65
|
+
'no-outputs-metadata-property',
|
|
66
|
+
'prefer-inject',
|
|
67
|
+
'prefer-on-push-component-change-detection',
|
|
68
|
+
'prefer-standalone',
|
|
69
|
+
'use-pipe-transform-interface',
|
|
70
|
+
].map((name) => [`angular/${name}`, 'error']),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
export function recommendedAngularRules(plugin, namespace) {
|
|
74
|
+
return Object.fromEntries(
|
|
75
|
+
Object.entries(plugin.rules)
|
|
76
|
+
.filter(([, rule]) => rule.meta.docs?.recommended === 'recommended')
|
|
77
|
+
.map(([name]) => [`${namespace}/${name}`, 'error']),
|
|
78
|
+
)
|
|
79
|
+
}
|
package/src/oxlint/index.d.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
// Keep Oxlint types in a separate ambient declaration file so existing ESLint
|
|
2
2
|
// consumers do not need to install the optional Oxlint peer.
|
|
3
|
+
declare module '@st1ggy/linter-config/angular-ox' {
|
|
4
|
+
import type { OxlintConfig } from 'oxlint'
|
|
5
|
+
|
|
6
|
+
const config: OxlintConfig
|
|
7
|
+
|
|
8
|
+
export default config
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module '@st1ggy/linter-config/vue-ox' {
|
|
12
|
+
import type { OxlintConfig } from 'oxlint'
|
|
13
|
+
|
|
14
|
+
const config: OxlintConfig
|
|
15
|
+
|
|
16
|
+
export default config
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '@st1ggy/linter-config/nuxt-ox' {
|
|
20
|
+
import type { OxlintConfig } from 'oxlint'
|
|
21
|
+
|
|
22
|
+
const config: OxlintConfig
|
|
23
|
+
|
|
24
|
+
export default config
|
|
25
|
+
}
|
|
26
|
+
|
|
3
27
|
declare module '@st1ggy/linter-config/common-ox' {
|
|
4
28
|
import type { OxlintConfig } from 'oxlint'
|
|
5
29
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { angularRules } from './framework-rules.js'
|
|
4
|
+
import common from './oxlint.config.common.js'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
...common,
|
|
8
|
+
ignorePatterns: [...common.ignorePatterns, '**/.angular/**', '**/dist/**'],
|
|
9
|
+
jsPlugins: [
|
|
10
|
+
...common.jsPlugins,
|
|
11
|
+
{ name: 'angular', specifier: fileURLToPath(new URL('plugins/angular.js', import.meta.url)) },
|
|
12
|
+
],
|
|
13
|
+
overrides: [...common.overrides, { files: ['**/*.ts'], rules: angularRules }],
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { nuxtRules } from './framework-rules.js'
|
|
4
|
+
import vue from './oxlint.config.vue.js'
|
|
5
|
+
|
|
6
|
+
const configRules = {
|
|
7
|
+
'nuxt/nuxt-config-keys-order': nuxtRules['nuxt/nuxt-config-keys-order'],
|
|
8
|
+
'nuxt/no-nuxt-config-test-key': nuxtRules['nuxt/no-nuxt-config-test-key'],
|
|
9
|
+
}
|
|
10
|
+
const scriptRules = Object.fromEntries(Object.entries(nuxtRules).filter(([name]) => !Object.hasOwn(configRules, name)))
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
...vue,
|
|
14
|
+
ignorePatterns: [...vue.ignorePatterns, '**/.nuxt/**', '**/.output/**'],
|
|
15
|
+
jsPlugins: [
|
|
16
|
+
...vue.jsPlugins,
|
|
17
|
+
{ name: 'nuxt', specifier: fileURLToPath(new URL('plugins/nuxt.js', import.meta.url)) },
|
|
18
|
+
],
|
|
19
|
+
overrides: [
|
|
20
|
+
...vue.overrides,
|
|
21
|
+
{ files: ['**/*.{js,mjs,cjs,ts,mts,cts,vue}'], rules: scriptRules },
|
|
22
|
+
{ files: ['**/nuxt.config.{js,mjs,cjs,ts,mts,cts}'], rules: configRules },
|
|
23
|
+
],
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@angular-eslint/eslint-plugin'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@nuxt/eslint-plugin'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from 'eslint-plugin
|
|
1
|
+
export { default } from '@eslint-react/eslint-plugin'
|
package/src/oxlint/stacks.js
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
export const OX_VERSIONS = { oxlint: '1.
|
|
2
|
-
export const OXFMT_VERSION = '0.
|
|
3
|
-
export const OXFMT_STACKS = ['common', 'react', 'solid', 'next']
|
|
1
|
+
export const OX_VERSIONS = { oxlint: '1.90.0', 'oxlint-tsgolint': '7.0.2005' }
|
|
2
|
+
export const OXFMT_VERSION = '0.75.0'
|
|
3
|
+
export const OXFMT_STACKS = ['common', 'react', 'solid', 'next', 'svelte', 'astro', 'angular', 'vue', 'nuxt']
|
|
4
|
+
// Optional compatibility exports only; never installed or generated by the Ox CLI.
|
|
5
|
+
export const SUPPLEMENT_STACKS = ['svelte', 'astro', 'angular', 'vue', 'nuxt']
|
|
6
|
+
|
|
7
|
+
export const OXFMT_PRESETS = {
|
|
8
|
+
svelte: 'oxfmt-svelte',
|
|
9
|
+
astro: 'oxfmt-astro',
|
|
10
|
+
angular: 'oxfmt-angular',
|
|
11
|
+
}
|
|
4
12
|
|
|
5
13
|
export function oxStackToolVersions(stack) {
|
|
6
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
...OX_VERSIONS,
|
|
16
|
+
...(OXFMT_STACKS.includes(stack) && { oxfmt: OXFMT_VERSION }),
|
|
17
|
+
}
|
|
7
18
|
}
|
|
8
19
|
|
|
9
20
|
// Only integrations actually used by the corresponding generated bundle.
|
|
10
21
|
export const OX_FRAMEWORK_PACKAGES = {
|
|
11
22
|
common: [],
|
|
12
|
-
react: ['eslint-plugin
|
|
23
|
+
react: ['@eslint-react/eslint-plugin', 'eslint-plugin-react-hooks'],
|
|
13
24
|
solid: ['eslint-plugin-solid'],
|
|
14
|
-
next: ['@next/eslint-plugin-next', 'eslint-plugin
|
|
15
|
-
svelte: ['eslint-plugin-svelte', '
|
|
16
|
-
astro: ['eslint-plugin-astro', '
|
|
25
|
+
next: ['@next/eslint-plugin-next', '@eslint-react/eslint-plugin', 'eslint-plugin-react-hooks'],
|
|
26
|
+
svelte: ['eslint-plugin-svelte', 'svelte'],
|
|
27
|
+
astro: ['eslint-plugin-astro', '@astrojs/compiler-rs'],
|
|
28
|
+
angular: ['@angular-eslint/eslint-plugin'],
|
|
29
|
+
vue: [],
|
|
30
|
+
nuxt: ['@nuxt/eslint-plugin'],
|
|
17
31
|
}
|