@1stg/eslint-config 11.0.0 → 12.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/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # Change Log
2
2
 
3
+ ## 12.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#415](https://github.com/1stG/configs/pull/415) [`a0276d4`](https://github.com/1stG/configs/commit/a0276d4bc5f6cbac18c01ee90945631375e0f851) Thanks [@JounQin](https://github.com/JounQin)! - feat!: defineConfig-based configs, Oxlint/Oxfmt and a thin ESLint
8
+
9
+ Every remaining config package now exports a `defineConfig(options)` factory
10
+ alongside the zero-config default. Options are explicit: the configs no longer
11
+ rely on ambient `CI`, `NODE_ENV`, `cwd` or git state; defaults may detect the
12
+ project structure or installed optional peers when `defineConfig()` is called.
13
+ Options extend the native config types (`OxfmtConfig`, `OxlintConfig`,
14
+ `prettier.Config`, `stylelint.Config`, `postcss.ProcessOptions`, ...), so
15
+ tool-specific fields pass through without being re-declared.
16
+
17
+ - `@1stg/eslint-config` now only covers the file types Oxlint cannot parse
18
+ (Markdown/JSON/YAML/TOML) and uses `eslint-plugin-oxlint` to avoid duplicate
19
+ reports; Markdown/JSON(C) and `eslint-plugin-oxlint` are installed by default,
20
+ YAML/TOML are optional peers, and `eslint-plugin-markup` can lint HTML on
21
+ Node >= 24 when installed.
22
+ `@1stg/babel-preset` is removed and JS/TS/Vue parsing moves to
23
+ [`@1stg/oxlint-config`](../packages/oxlint-config).
24
+ - New [`@1stg/oxlint-config`](../packages/oxlint-config) (Oxlint) and
25
+ [`@1stg/oxfmt-config`](../packages/oxfmt-config) (Oxfmt). Framework plugins are
26
+ enabled when the framework is installed; formatting is no longer an ESLint
27
+ rule by default.
28
+ - `@1stg/prettier-config` is kept for the languages Oxfmt cannot format (Pug,
29
+ Ruby, shell, INI, properties, Stylus, Sass). Its plugins are optional peer
30
+ dependencies (discovered from this package's `dependencies` + optional
31
+ `peerDependencies`), with `prettier-plugin-pkg` installed by default; the
32
+ `/next` (`babel-ts`) variant is gone with Babel.
33
+ - `@1stg/nano-staged` takes `formatter` (`'oxfmt' | 'prettier' | 'both'`),
34
+ `linter` (`'oxlint' | 'eslint'`) and `typecheck` options instead of
35
+ per-framework entry points (`/tsc`, `/ngc`, `/vue-tsc`). Linter, stylelint,
36
+ type-coverage and imagemin are auto-detected from installed packages.
37
+ - `@1stg/stylelint-config` takes `scss`, `scssLoose`, `modules` and `prettier`
38
+ options; `stylelint-prettier` is an optional peer enabled when installed, and
39
+ `vue` is enabled when `vue` is installed.
40
+ - `@1stg/markuplint-config` takes `vue` instead of the `/angular` and `/vue`
41
+ subpaths. Angular support is dropped, including the `@1stg/tsconfig/angular`
42
+ and `ng-lib` presets.
43
+ - `@1stg/commitlint-config` takes `monorepo` (defaulting to `isMonorepo()`);
44
+ `@1stg/simple-git-hooks` takes `runner` and only emits hooks for installed
45
+ `nano-staged`/`@commitlint/cli`.
46
+ - `@1stg/postcss-config` is ESM only (use `postcss.config.js`), minifies based
47
+ on its `env` option rather than a module-level `NODE_ENV` snapshot, and extends
48
+ `postcss.ProcessOptions`; accepts `minify`, `map`, `cssnano`, `presetOptions`
49
+ and extra `plugins`.
50
+ - All packages are authored in TypeScript and built with `tsc -b` into `lib/`;
51
+ declarations are generated, the hand-written `.d.ts` files are gone, and
52
+ `yarn build` runs on install and release.
53
+ - All packages publish explicit `exports.types`, a `files` allow-list, and
54
+ consistent Node.js engines.
55
+ - `@1stg/browserslist-config` is ESM only (browserslist >= 4.24.5) and drops
56
+ the `alauda` and `alauda-legacy` presets.
57
+
58
+ ### Minor Changes
59
+
60
+ - [#421](https://github.com/1stG/configs/pull/421) [`e3b113d`](https://github.com/1stG/configs/commit/e3b113d17a63c9d8b85a7d955c6128a4c4cf08cd) Thanks [@JounQin](https://github.com/JounQin)! - Add a `code` mode that lints JS/TS/JSX with `typescript-eslint` and
61
+ optional `eslint-plugin-regexp` / `eslint-plugin-sonarjs`, while `eslint-plugin-oxlint` keeps rules
62
+ already covered by Oxlint disabled. It is enabled automatically when `typescript-eslint` is installed; pass
63
+ `code: false` to disable it.
64
+
65
+ ## 11.1.0
66
+
67
+ ### Minor Changes
68
+
69
+ - [#408](https://github.com/1stG/configs/pull/408) [`f84e555`](https://github.com/1stG/configs/commit/f84e555582d1f176bb2ac955f1b4982b6e1da0ec) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): bump `eslint-plugin-markup` to v2 and require Node.js `>=24.11.0`
70
+
71
+ `eslint-plugin-markup@2` needs Node.js `>=24`, so `@1stg/eslint-config` now
72
+ declares the intersection of its dependencies' engines. The plugin also moves to
73
+ `markuplint@^5`, which removes the duplicate markuplint 4 tree that the previous
74
+ release carried alongside markuplint 5.
75
+
3
76
  ## 11.0.0
4
77
 
5
78
  ### Major Changes
package/README.md CHANGED
@@ -1,6 +1,67 @@
1
1
  # @1stg/eslint-config
2
2
 
3
- Personal but Shareable ESLint Configuration for all 1stG.me projects
3
+ ESLint is kept for the file types Oxlint cannot parse:
4
+
5
+ - Markdown/MDX (`eslint-plugin-mdx`)
6
+ - JSON/JSONC/JSON5 (`eslint-plugin-jsonc`)
7
+ - YAML (`eslint-plugin-yml`)
8
+ - TOML (`eslint-plugin-toml`)
9
+
10
+ JS/TS/JSX/Vue are owned by `@1stg/oxlint-config`. When `typescript-eslint` is
11
+ installed, `code` mode is enabled automatically and additionally lints
12
+ JS/TS/JSX with `typescript-eslint` plus optional `eslint-plugin-regexp` /
13
+ `eslint-plugin-sonarjs`, while `eslint-plugin-oxlint` disables every rule
14
+ Oxlint already covers. Pass `code: false` to keep the thin file-type-only
15
+ behavior. Vue templates remain with Oxlint/markuplint.
16
+
17
+ ## Usage
18
+
19
+ ```js
20
+ // eslint.config.js
21
+ import { defineConfig } from '@1stg/eslint-config'
22
+
23
+ export default defineConfig()
24
+ ```
25
+
26
+ `eslint-plugin-mdx`, `eslint-plugin-jsonc` and `eslint-plugin-oxlint` are
27
+ installed by default, so Markdown/JSON(C) linting and the Oxlint rule-disable
28
+ list are on. `eslint-plugin-yml` and `eslint-plugin-toml` are optional peers,
29
+ enabled only when installed (`import.meta.resolve`). ESLint awaits the returned promise. Use
30
+ `export default await defineConfig()` if your tool does not await it.
31
+
32
+ `eslint-plugin-markup` is an optional peer: when installed on Node >= 24,
33
+ `markup` is enabled by default and `**/*.html` is no longer ignored. The
34
+ default ignores skip code owned by Oxlint (`.js/.ts/.jsx/.tsx/.vue`), styles
35
+ owned by Stylelint, HTML owned by markuplint, lockfiles and build output.
36
+ `code` defaults to whether `typescript-eslint` is installed. Setting
37
+ `code: true` requires `typescript-eslint` to be installed and throws otherwise;
38
+ `code: false` disables it. Run ESLint only on the non-code extensions when
39
+ code mode is off:
40
+
41
+ ```sh
42
+ eslint "**/*.{md,mdx,json,jsonc,json5,yaml,yml,toml}"
43
+ ```
44
+
45
+ The default export can be re-exported directly:
46
+
47
+ ```js
48
+ export { default } from '@1stg/eslint-config'
49
+ ```
50
+
51
+ Use `defineConfig` only when you need options.
52
+
53
+ ## Options
54
+
55
+ | Option | Default | Description |
56
+ | ---------- | ----------------------------- | ------------------------------------------------------------------- |
57
+ | `markdown` | `true` | Lint Markdown/MDX. |
58
+ | `jsonc` | `true` | Lint JSON/JSONC/JSON5. |
59
+ | `yaml` | installed | Lint YAML when installed. |
60
+ | `toml` | installed | Lint TOML when installed. |
61
+ | `code` | installed `typescript-eslint` | Lint JS/TS/JSX with rules Oxlint does not cover. |
62
+ | `oxlint` | `true` | Disable rules Oxlint already owns. |
63
+ | `markup` | auto | Lint HTML with `eslint-plugin-markup` on Node >= 24 when installed. |
64
+ | `ignores` | `[]` | Extra ignore patterns. |
4
65
 
5
66
  ## Sponsors and Backers
6
67
 
package/lib/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface EslintConfigOptions {
3
+ markdown?: boolean;
4
+ jsonc?: boolean;
5
+ yaml?: boolean;
6
+ toml?: boolean;
7
+ markup?: boolean;
8
+ code?: boolean;
9
+ oxlint?: boolean;
10
+ ignores?: string[];
11
+ }
12
+ export declare const defineConfig: ({ markdown, jsonc: jsoncEnabled, yaml, toml: tomlEnabled, oxlint: oxlintEnabled, code, markup, ignores, }?: EslintConfigOptions) => Promise<Linter.Config[]>;
13
+ declare const _default: Promise<Linter.Config<import("@eslint/core").RulesConfig>[]>;
14
+ export default _default;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,MAAM,WAAW,mBAAmB;IAElC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AA6ED,eAAO,MAAM,YAAY,+GAStB,mBAAmB,KAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CA6EpD,CAAA"}
package/lib/index.js ADDED
@@ -0,0 +1,107 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
11
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
12
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
13
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
14
+ });
15
+ }
16
+ return path;
17
+ };
18
+ const NODE_MAJOR = Number(process.versions.node.split('.')[0]);
19
+ const CODE_IGNORES = '**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}';
20
+ const DEFAULT_IGNORES = [
21
+ '**/.dsh/**',
22
+ '**/.history/**',
23
+ '**/.type-coverage/**',
24
+ '**/.vercel/**',
25
+ '**/.yarn/**',
26
+ '**/.pnp.*',
27
+ '**/coverage/**',
28
+ '**/dist/**',
29
+ '**/lib/**',
30
+ '**/node_modules/**',
31
+ '**/CHANGELOG.md',
32
+ '**/yarn.lock',
33
+ '**/package-lock.json',
34
+ '**/pnpm-lock.yaml',
35
+ '**/auto-imports.d.ts',
36
+ '**/*.log',
37
+ '**/*.patch',
38
+ '**/*.min.*',
39
+ CODE_IGNORES,
40
+ '**/*.vue',
41
+ '**/*.{css,less,sass,scss,styl,stylus}',
42
+ '**/*.html',
43
+ ];
44
+ const toConfigs = (config) => Array.isArray(config) ? config : [config];
45
+ const withCodeFiles = (config) => { var _a; return (Object.assign(Object.assign({}, config), { files: (_a = config.files) !== null && _a !== void 0 ? _a : [CODE_IGNORES] })); };
46
+ const isInstalled = (name) => {
47
+ try {
48
+ return Boolean(import.meta.resolve(name));
49
+ }
50
+ catch (_a) {
51
+ return false;
52
+ }
53
+ };
54
+ const load = (name) => __awaiter(void 0, void 0, void 0, function* () {
55
+ var _a;
56
+ const mod = (yield import(__rewriteRelativeImportExtension(name, true)));
57
+ return ((_a = mod.default) !== null && _a !== void 0 ? _a : mod);
58
+ });
59
+ export const defineConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ markdown = true, jsonc: jsoncEnabled = true, yaml = isInstalled('eslint-plugin-yml'), toml: tomlEnabled = isInstalled('eslint-plugin-toml'), oxlint: oxlintEnabled = true, code = isInstalled('typescript-eslint'), markup = NODE_MAJOR >= 24 && isInstalled('eslint-plugin-markup'), ignores = [], } = {}) {
60
+ const defaultIgnores = DEFAULT_IGNORES.filter(pattern => (!markup || pattern !== '**/*.html') && (!code || pattern !== CODE_IGNORES));
61
+ const configs = [{ ignores: [...defaultIgnores, ...ignores] }];
62
+ if (markup) {
63
+ if (NODE_MAJOR < 24) {
64
+ throw new Error('@1stg/eslint-config: `markup` requires Node.js >= 24 (eslint-plugin-markup@2)');
65
+ }
66
+ const markupPlugin = yield load('eslint-plugin-markup');
67
+ configs.push(markupPlugin.configs.flatRecommended);
68
+ }
69
+ if (code) {
70
+ if (!isInstalled('typescript-eslint')) {
71
+ throw new Error('@1stg/eslint-config: `code` requires the `typescript-eslint` package');
72
+ }
73
+ const tseslint = yield load('typescript-eslint');
74
+ configs.push(...tseslint.configs.recommended.map(withCodeFiles));
75
+ if (isInstalled('eslint-plugin-sonarjs')) {
76
+ const sonarjs = yield load('eslint-plugin-sonarjs');
77
+ configs.push(...toConfigs(sonarjs.configs.recommended).map(withCodeFiles));
78
+ }
79
+ if (isInstalled('eslint-plugin-regexp')) {
80
+ const regexp = yield load('eslint-plugin-regexp');
81
+ configs.push(...toConfigs(regexp.configs['flat/recommended']).map(withCodeFiles));
82
+ }
83
+ }
84
+ if (oxlintEnabled) {
85
+ const oxlint = yield load('eslint-plugin-oxlint');
86
+ configs.push(...toConfigs(oxlint.configs['flat/all']));
87
+ }
88
+ if (markdown) {
89
+ const mdx = yield load('eslint-plugin-mdx');
90
+ configs.push(Object.assign(Object.assign({}, mdx.flat), { processor: mdx.createRemarkProcessor({ lintCodeBlocks: false }) }));
91
+ }
92
+ if (jsoncEnabled) {
93
+ const jsonc = yield load('eslint-plugin-jsonc');
94
+ configs.push(...toConfigs(jsonc.configs['flat/recommended-with-jsonc']), ...toConfigs(jsonc.configs['flat/prettier']));
95
+ }
96
+ if (yaml) {
97
+ const yml = yield load('eslint-plugin-yml');
98
+ configs.push(...toConfigs(yml.configs['flat/recommended']), ...toConfigs(yml.configs['flat/prettier']));
99
+ }
100
+ if (tomlEnabled) {
101
+ const toml = yield load('eslint-plugin-toml');
102
+ configs.push(...toConfigs(toml.configs['flat/recommended']));
103
+ }
104
+ return configs;
105
+ });
106
+ export default defineConfig();
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA8BA,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE9D,MAAM,YAAY,GAAG,sCAAsC,CAAA;AAE3D,MAAM,eAAe,GAAG;IACtB,YAAY;IACZ,gBAAgB;IAChB,sBAAsB;IACtB,eAAe;IACf,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,WAAW;IACX,oBAAoB;IACpB,iBAAiB;IACjB,cAAc;IACd,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,UAAU;IACV,YAAY;IACZ,YAAY;IAEZ,YAAY;IACZ,UAAU;IACV,uCAAuC;IACvC,WAAW;CACZ,CAAA;AAKD,MAAM,SAAS,GAAG,CAAC,MAAuC,EAAmB,EAAE,CAC7E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3C,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAiB,EAAE,kBAAC,iCAC3D,MAAM,KACT,KAAK,QAAE,MAAM,CAAC,KAAK,mCAAI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
4
4
  "type": "module",
5
- "description": "Personal but Shareable ESLint Configuration for all 1stG.me projects",
5
+ "description": "Personal but Shareable ESLint Configuration for the files Oxlint cannot lint",
6
6
  "repository": "git+https://github.com/1stG/configs.git",
7
7
  "homepage": "https://github.com/1stG/configs/tree/master/packages/eslint-config",
8
8
  "author": "JounQin <admin@1stg.me> (https://www.1stG.me)",
@@ -11,90 +11,51 @@
11
11
  "engines": {
12
12
  "node": "^22.18.0 || >=24.11.0"
13
13
  },
14
- "main": "index.js",
14
+ "main": "./lib/index.js",
15
+ "types": "./lib/index.d.ts",
15
16
  "exports": {
16
- ".": "./index.js",
17
- "./package.json": "./package.json",
18
- "./base": "./base.js",
19
- "./loose": "./loose.js",
20
- "./overrides": "./overrides.js",
21
- "./recommended": "./recommended.js"
17
+ ".": {
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./package.json": "./package.json"
22
22
  },
23
+ "files": [
24
+ "lib"
25
+ ],
23
26
  "peerDependencies": {
24
- "@babel/eslint-parser": "^8.0.0",
25
- "@babel/eslint-plugin": "^8.0.0",
26
- "@eslint-react/eslint-plugin": ">=1.0.0",
27
- "@vitest/eslint-plugin": "^1.0.0",
28
- "angular-eslint": ">=18.0.0",
29
- "angular-eslint-template-parser": "^0.1.0",
30
- "eslint": ">=8.0.0",
31
- "eslint-plugin-jest": ">=28.0.0",
32
- "eslint-plugin-node-dependencies": "^1.3.0 || ^2.0.0",
33
- "eslint-plugin-react-hooks": ">=5.0.0",
34
- "eslint-plugin-react-refresh": "^0.4.26 || ^0.5.0",
35
- "eslint-plugin-vue": "^10.0.0"
27
+ "eslint": "^9.39.4 || ^10.0.1",
28
+ "eslint-plugin-markup": "^2.1.0",
29
+ "eslint-plugin-regexp": "^3.3.1",
30
+ "eslint-plugin-sonarjs": "^4.2.2",
31
+ "eslint-plugin-toml": "^1.5.0",
32
+ "eslint-plugin-yml": "^3.9.0",
33
+ "typescript-eslint": "^8.72.0"
36
34
  },
37
35
  "peerDependenciesMeta": {
38
- "@babel/eslint-parser": {
39
- "optional": true
40
- },
41
- "@babel/eslint-plugin": {
42
- "optional": true
43
- },
44
- "@eslint-react/eslint-plugin": {
45
- "optional": true
46
- },
47
- "@vitest/eslint-plugin": {
48
- "optional": true
49
- },
50
- "angular-eslint": {
51
- "optional": true
52
- },
53
- "angular-eslint-template-parser": {
36
+ "eslint-plugin-markup": {
54
37
  "optional": true
55
38
  },
56
- "eslint-plugin-jest": {
39
+ "eslint-plugin-regexp": {
57
40
  "optional": true
58
41
  },
59
- "eslint-plugin-node-dependencies": {
42
+ "eslint-plugin-sonarjs": {
60
43
  "optional": true
61
44
  },
62
- "eslint-plugin-react-hooks": {
45
+ "eslint-plugin-toml": {
63
46
  "optional": true
64
47
  },
65
- "eslint-plugin-react-refresh": {
48
+ "eslint-plugin-yml": {
66
49
  "optional": true
67
50
  },
68
- "eslint-plugin-vue": {
51
+ "typescript-eslint": {
69
52
  "optional": true
70
53
  }
71
54
  },
72
55
  "dependencies": {
73
- "@1stg/config": "^1.2.0",
74
- "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
75
- "@eslint/js": "^9.39.4 || ^10.0.1",
76
- "@pkgr/utils": "^4.1.0",
77
- "@typescript-eslint/eslint-plugin": "^8.60.0",
78
- "@typescript-eslint/parser": "^8.60.0",
79
- "eslint-config-prettier": "^10.1.8",
80
- "eslint-import-resolver-typescript": "^4.4.4",
81
- "eslint-plugin-css": "^0.12.0",
82
- "eslint-plugin-import-x": "^4.16.2",
83
- "eslint-plugin-jsdoc": ">=50.8.0",
84
- "eslint-plugin-jsonc": "^2.21.1 || ^3.2.0",
85
- "eslint-plugin-markup": "^1.0.1",
86
- "eslint-plugin-mdx": "^3.7.1",
87
- "eslint-plugin-n": "^17.24.0 || ^18.0.1",
88
- "eslint-plugin-prettier": "^5.5.6",
89
- "eslint-plugin-promise": "^7.3.0",
90
- "eslint-plugin-regexp": "^2.10.0 || ^3.1.0",
91
- "eslint-plugin-simple-import-sort": "^14.0.0",
92
- "eslint-plugin-sonarjs": "^4.0.3",
93
- "eslint-plugin-toml": "^0.13.1 || ^1.4.0",
94
- "eslint-plugin-unicorn-x": "^2.0.0 || ^3.2.1",
95
- "eslint-plugin-yml": "^1.19.1 || ^2.0.2 || ^3.4.0",
96
- "globals": "^17.6.0",
97
- "typescript-eslint": "^8.60.0"
56
+ "eslint-plugin-jsonc": "^3.4.2",
57
+ "eslint-plugin-mdx": "^3.8.2",
58
+ "eslint-plugin-oxlint": "^1.89.0"
98
59
  },
99
60
  "publishConfig": {
100
61
  "access": "public"
package/_util.js DELETED
@@ -1,86 +0,0 @@
1
- // @ts-check
2
-
3
- import path from 'node:path'
4
-
5
- import { isCI, isEnvDisabled, isEnvEnabled, preferPrettier } from '@1stg/config'
6
- import {
7
- isMonorepo,
8
- isPkgAvailable,
9
- getMonorepoPkgs,
10
- tryRequirePkg,
11
- tryFile,
12
- tryPkg,
13
- } from '@pkgr/utils'
14
- import configPrettier from 'eslint-config-prettier'
15
- import prettierRecommended from 'eslint-plugin-prettier/recommended'
16
- import tseslint from 'typescript-eslint'
17
-
18
- /** @type {string[]} */
19
- let allowModules = []
20
-
21
- if (isMonorepo()) {
22
- allowModules = getMonorepoPkgs().reduce((acc, pkg) => {
23
- const pkgJson = tryRequirePkg(path.resolve(pkg, 'package.json'))
24
- if (!pkgJson) {
25
- return acc
26
- }
27
- const { name, peerDependencies = {}, dependencies = {} } = pkgJson
28
- // eslint-disable-next-line unicorn-x/prefer-spread
29
- return acc.concat(
30
- name,
31
- Object.keys(peerDependencies),
32
- Object.keys(dependencies),
33
- )
34
- }, /** @type {string[]} */ ([]))
35
- }
36
-
37
- export { allowModules }
38
-
39
- export const isTsAvailable = isPkgAvailable('typescript')
40
-
41
- export const isWebpackAvailable =
42
- isPkgAvailable('webpack') || isPkgAvailable('@rspack/core')
43
-
44
- export const isReactPluginAvailable = isPkgAvailable(
45
- '@eslint-react/eslint-plugin',
46
- )
47
-
48
- export const webpackSpecVars = [
49
- '__non_webpack_require__',
50
- '__resourceQuery',
51
- '__webpack_chunk_load__',
52
- '__webpack_exports_info__',
53
- '__webpack_hash__',
54
- '__webpack_modules__',
55
- '__webpack_public_path__',
56
- '__webpack_require__',
57
- '__webpack_runtime_id__',
58
- 'DEBUG',
59
- ]
60
-
61
- export const magicNumbers = [
62
- -1, 0, 1, 2, 3, 5, 7, 10, 12, 15, 20, 24, 30, 31, 50, 60, 100, 365, 366, 500,
63
- 768, 1000, 1024, 3600, 4200, 8080,
64
- ]
65
-
66
- export const prettierExtends = tseslint.config(
67
- preferPrettier ? configPrettier : prettierRecommended,
68
- )
69
-
70
- export const project =
71
- tryFile('tsconfig.eslint.json') ||
72
- tryFile('tsconfig.base.json') ||
73
- tryFile('tsconfig.json') ||
74
- tryPkg('@1stg/tsconfig')
75
-
76
- export const nonSourceRules = /** @type {const} */ ({
77
- 'n/no-extraneous-import': 0,
78
- 'n/no-extraneous-require': 0,
79
- 'n/no-unsupported-features/es-builtins': 0,
80
- })
81
-
82
- const ESLINT_NODE_DEPS_ENV = 'ESLINT_NODE_DEPS'
83
-
84
- export const isEslintNodeDepsEnabled = isCI
85
- ? !isEnvDisabled(ESLINT_NODE_DEPS_ENV)
86
- : isEnvEnabled(ESLINT_NODE_DEPS_ENV)
package/angular.js DELETED
@@ -1,43 +0,0 @@
1
- // @ts-check
2
-
3
- import { preferPrettier } from '@1stg/config'
4
- import angular_ from 'angular-eslint'
5
- import angularTemplateParser from 'angular-eslint-template-parser'
6
- import * as markup_ from 'eslint-plugin-markup'
7
- import tseslint from 'typescript-eslint'
8
-
9
- import { prettierExtends } from './_util.js'
10
-
11
- export const angular = tseslint.config(
12
- {
13
- name: '@1stg/angular-ts',
14
- files: ['**/*.ts'],
15
- ignores: ['**/*.d.ts'],
16
- extends: [angular_.configs.tsRecommended, prettierExtends],
17
- processor: angular_.processInlineTemplates,
18
- rules: {
19
- '@angular-eslint/prefer-on-push-component-change-detection': 1,
20
- },
21
- },
22
- {
23
- name: '@1stg/angular-template',
24
- files: ['**/*.html'],
25
- extends: [
26
- angular_.configs.templateRecommended,
27
- markup_.configs.flatRecommended,
28
- prettierExtends,
29
- ],
30
- languageOptions: {
31
- parser: angularTemplateParser,
32
- },
33
- rules: {
34
- '@angular-eslint/template/eqeqeq': [2, { allowNullOrUndefined: true }],
35
- 'prettier/prettier': preferPrettier ? 0 : [2, { parser: 'angular' }],
36
- 'spaced-comment': 0,
37
- },
38
- },
39
- {
40
- files: ['**/*inline-template-*.component.html'],
41
- rules: { 'unicorn-x/no-empty-file': 0 },
42
- },
43
- )
package/base.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { TSESLint } from '@typescript-eslint/utils'
2
-
3
- export const base: TSESLint.FlatConfig.ConfigArray