@useinsider/eslint-config 4.0.0 → 4.1.0-beta.2
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 +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/configs/strict/index.d.ts +4 -0
- package/dist/configs/typescript-dom/index.d.ts +11 -0
- package/dist/configs/vue2/index.d.ts +11 -0
- package/dist/configs/vue2-options-api/index.d.ts +11 -0
- package/dist/configs/vue3/index.d.ts +11 -0
- package/dist/configs/vue3-options-api/index.d.ts +11 -0
- package/dist/{javascript-ycJ4W-e9.cjs → javascript-BhE-GPB6.cjs} +3 -3
- package/dist/javascript-BhE-GPB6.cjs.map +1 -0
- package/dist/{javascript-9ynvToz3.js → javascript-I1vickTx.js} +3 -3
- package/dist/javascript-I1vickTx.js.map +1 -0
- package/dist/{javascript-dom-bySaQErv.cjs → javascript-dom-B8OEUnM-.cjs} +2 -2
- package/dist/javascript-dom-B8OEUnM-.cjs.map +1 -0
- package/dist/{javascript-dom-B1wtLzJC.js → javascript-dom-DxICKI9F.js} +2 -2
- package/dist/javascript-dom-DxICKI9F.js.map +1 -0
- package/dist/{javascript-node-DZxexKer.cjs → javascript-node-C8Wco4mW.cjs} +2 -2
- package/dist/javascript-node-C8Wco4mW.cjs.map +1 -0
- package/dist/{javascript-node-JaASOojH.js → javascript-node-DwHDtzU3.js} +2 -2
- package/dist/javascript-node-DwHDtzU3.js.map +1 -0
- package/dist/jest-B2fpQmUB.cjs.map +1 -1
- package/dist/jsdoc-based-ts-BR3FTVAt.cjs +15 -0
- package/dist/jsdoc-based-ts-BR3FTVAt.cjs.map +1 -0
- package/dist/jsdoc-based-ts-BWfTAH0H.js +13 -0
- package/dist/jsdoc-based-ts-BWfTAH0H.js.map +1 -0
- package/dist/main.cjs +18 -17
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +18 -17
- package/dist/main.js.map +1 -1
- package/dist/merge-DJQU2y2U.cjs.map +1 -1
- package/dist/merge-R5ZHqMsV.js.map +1 -1
- package/dist/mergeAllConfig-CqddZ81h.cjs +39 -0
- package/dist/mergeAllConfig-CqddZ81h.cjs.map +1 -0
- package/dist/mergeAllConfig-D0OcACtk.js +28 -0
- package/dist/mergeAllConfig-D0OcACtk.js.map +1 -0
- package/dist/{removePluginsFromConfigs-D0oSUj2C.cjs → removePluginsFromConfigs-Cz6Uo9G0.cjs} +7 -2
- package/dist/{removePluginsFromConfigs-D0oSUj2C.cjs.map → removePluginsFromConfigs-Cz6Uo9G0.cjs.map} +1 -1
- package/dist/{removePluginsFromConfigs-DzqX2Ju2.js → removePluginsFromConfigs-Di0LcQV7.js} +7 -2
- package/dist/{removePluginsFromConfigs-DzqX2Ju2.js.map → removePluginsFromConfigs-Di0LcQV7.js.map} +1 -1
- package/dist/removedOptions-BYMW8w__.cjs.map +1 -1
- package/dist/{strict-DnJFBY_B.cjs → strict-CF-NM1Kz.cjs} +3 -1
- package/dist/strict-CF-NM1Kz.cjs.map +1 -0
- package/dist/{strict-BHw_cKrv.js → strict-DSSQSR-R.js} +3 -1
- package/dist/strict-DSSQSR-R.js.map +1 -0
- package/dist/stylistic-B2hCwBRu.cjs.map +1 -1
- package/dist/stylistic-B6j4I_aN.js.map +1 -1
- package/dist/{typescript-DdgbCNKI.cjs → typescript-ApKqX3iV.cjs} +4 -4
- package/dist/typescript-ApKqX3iV.cjs.map +1 -0
- package/dist/{typescript-dom-C0NNSGLd.cjs → typescript-dom-CSLhOftX.cjs} +2 -2
- package/dist/typescript-dom-CSLhOftX.cjs.map +1 -0
- package/dist/{typescript-dom-ClE8ufzf.js → typescript-dom-DrUOOnM4.js} +2 -2
- package/dist/typescript-dom-DrUOOnM4.js.map +1 -0
- package/dist/{typescript-node-CjG8N83q.cjs → typescript-node-CnUbeHuf.cjs} +2 -2
- package/dist/typescript-node-CnUbeHuf.cjs.map +1 -0
- package/dist/{typescript-node-CbViUIa8.js → typescript-node-U_PxeVo_.js} +2 -2
- package/dist/typescript-node-U_PxeVo_.js.map +1 -0
- package/dist/{typescript-C7Xg57WE.js → typescript-pXnqzNcq.js} +4 -4
- package/dist/typescript-pXnqzNcq.js.map +1 -0
- package/dist/utils/mergeAllConfig.d.ts +10 -0
- package/dist/vitest-B3kOWOzo.cjs.map +1 -1
- package/dist/vue2-CVSRM5hR.js.map +1 -1
- package/dist/vue2-CwpD2fD-.cjs.map +1 -1
- package/dist/{vue2-CYgPhPVM.js → vue2-DdYrB6mY.js} +3 -3
- package/dist/vue2-DdYrB6mY.js.map +1 -0
- package/dist/{vue2-DfL5FqeZ.cjs → vue2-DiPq5PQL.cjs} +3 -3
- package/dist/vue2-DiPq5PQL.cjs.map +1 -0
- package/dist/{vue2-options-api-Dvem0WyV.js → vue2-options-api-Cy5rsR-j.js} +3 -3
- package/dist/vue2-options-api-Cy5rsR-j.js.map +1 -0
- package/dist/{vue2-options-api-sSrBV5Si.cjs → vue2-options-api-vM4-fZ6j.cjs} +3 -3
- package/dist/vue2-options-api-vM4-fZ6j.cjs.map +1 -0
- package/dist/{vue2-typescript-BbhsVbsV.js → vue2-typescript-DCIz2ov3.js} +4 -4
- package/dist/vue2-typescript-DCIz2ov3.js.map +1 -0
- package/dist/{vue2-typescript-rJIMzNUI.cjs → vue2-typescript-DEjU21DD.cjs} +4 -4
- package/dist/vue2-typescript-DEjU21DD.cjs.map +1 -0
- package/dist/{vue2-typescript-options-api-CbRC2wf-.cjs → vue2-typescript-options-api-BtNnq3wL.cjs} +4 -4
- package/dist/vue2-typescript-options-api-BtNnq3wL.cjs.map +1 -0
- package/dist/{vue2-typescript-options-api-A5jU6hdD.js → vue2-typescript-options-api-DFuio9yN.js} +4 -4
- package/dist/vue2-typescript-options-api-DFuio9yN.js.map +1 -0
- package/dist/{vue3-haIiBEhv.js → vue3-9MhNouTa.js} +3 -3
- package/dist/vue3-9MhNouTa.js.map +1 -0
- package/dist/{vue3-DmrGRHbo.cjs → vue3-ByjWQqwT.cjs} +3 -3
- package/dist/vue3-ByjWQqwT.cjs.map +1 -0
- package/dist/{vue3-options-api-DkF4JagY.js → vue3-options-api-BCl74Vf3.js} +3 -3
- package/dist/vue3-options-api-BCl74Vf3.js.map +1 -0
- package/dist/{vue3-options-api-DPEk8rBk.cjs → vue3-options-api-DJdkd16_.cjs} +3 -3
- package/dist/vue3-options-api-DJdkd16_.cjs.map +1 -0
- package/dist/{vue3-typescript-Dz5BM0LJ.cjs → vue3-typescript-DA7VQ2SA.cjs} +4 -4
- package/dist/vue3-typescript-DA7VQ2SA.cjs.map +1 -0
- package/dist/{vue3-typescript-BRN2iL98.js → vue3-typescript-Da3q8XWj.js} +4 -4
- package/dist/vue3-typescript-Da3q8XWj.js.map +1 -0
- package/dist/{vue3-typescript-options-api-BZ-QVwuD.js → vue3-typescript-options-api-CMd_B9lh.js} +4 -4
- package/dist/vue3-typescript-options-api-CMd_B9lh.js.map +1 -0
- package/dist/{vue3-typescript-options-api-DiYz_vVd.cjs → vue3-typescript-options-api-ip2iRljT.cjs} +4 -4
- package/dist/vue3-typescript-options-api-ip2iRljT.cjs.map +1 -0
- package/package.json +27 -27
- package/dist/javascript-9ynvToz3.js.map +0 -1
- package/dist/javascript-dom-B1wtLzJC.js.map +0 -1
- package/dist/javascript-dom-bySaQErv.cjs.map +0 -1
- package/dist/javascript-node-DZxexKer.cjs.map +0 -1
- package/dist/javascript-node-JaASOojH.js.map +0 -1
- package/dist/javascript-ycJ4W-e9.cjs.map +0 -1
- package/dist/jsdoc-based-ts-Cfahz0nn.cjs +0 -6
- package/dist/jsdoc-based-ts-Cfahz0nn.cjs.map +0 -1
- package/dist/jsdoc-based-ts-D7tlky3K.js +0 -6
- package/dist/jsdoc-based-ts-D7tlky3K.js.map +0 -1
- package/dist/mergeAllConfig-B2rSXCdn.js +0 -9
- package/dist/mergeAllConfig-B2rSXCdn.js.map +0 -1
- package/dist/mergeAllConfig-DjMWjBNg.cjs +0 -14
- package/dist/mergeAllConfig-DjMWjBNg.cjs.map +0 -1
- package/dist/strict-BHw_cKrv.js.map +0 -1
- package/dist/strict-DnJFBY_B.cjs.map +0 -1
- package/dist/typescript-C7Xg57WE.js.map +0 -1
- package/dist/typescript-DdgbCNKI.cjs.map +0 -1
- package/dist/typescript-dom-C0NNSGLd.cjs.map +0 -1
- package/dist/typescript-dom-ClE8ufzf.js.map +0 -1
- package/dist/typescript-node-CbViUIa8.js.map +0 -1
- package/dist/typescript-node-CjG8N83q.cjs.map +0 -1
- package/dist/vue2-CYgPhPVM.js.map +0 -1
- package/dist/vue2-DfL5FqeZ.cjs.map +0 -1
- package/dist/vue2-options-api-Dvem0WyV.js.map +0 -1
- package/dist/vue2-options-api-sSrBV5Si.cjs.map +0 -1
- package/dist/vue2-typescript-BbhsVbsV.js.map +0 -1
- package/dist/vue2-typescript-options-api-A5jU6hdD.js.map +0 -1
- package/dist/vue2-typescript-options-api-CbRC2wf-.cjs.map +0 -1
- package/dist/vue2-typescript-rJIMzNUI.cjs.map +0 -1
- package/dist/vue3-DmrGRHbo.cjs.map +0 -1
- package/dist/vue3-haIiBEhv.js.map +0 -1
- package/dist/vue3-options-api-DPEk8rBk.cjs.map +0 -1
- package/dist/vue3-options-api-DkF4JagY.js.map +0 -1
- package/dist/vue3-typescript-BRN2iL98.js.map +0 -1
- package/dist/vue3-typescript-Dz5BM0LJ.cjs.map +0 -1
- package/dist/vue3-typescript-options-api-BZ-QVwuD.js.map +0 -1
- package/dist/vue3-typescript-options-api-DiYz_vVd.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-DJQU2y2U.cjs","names":[],"sources":["../../utils/dist/index.js","../src/utils/merge.ts"],"sourcesContent":["//#region src/merge.ts\nvar UNSAFE_KEYS = /* @__PURE__ */ new Set([\n\t\"__proto__\",\n\t\"constructor\",\n\t\"prototype\",\n\t\"toString\",\n\t\"valueOf\",\n\t\"hasOwnProperty\",\n\t\"isPrototypeOf\",\n\t\"propertyIsEnumerable\",\n\t\"toLocaleString\"\n]);\nvar defaultOptions = {\n\tallowUndefinedOverrides: true,\n\tmergeArrays: true,\n\tuniqueArrayItems: true\n};\nfunction isMergeableObject(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction combineArrays(options, previous, next) {\n\tif (!options.mergeArrays) return next;\n\treturn options.uniqueArrayItems ? [.../* @__PURE__ */ new Set([...previous, ...next])] : [...previous, ...next];\n}\nfunction mergeSources(options, sources) {\n\treturn sources.reduce((result, source) => {\n\t\tif (Array.isArray(source)) throw new TypeError(\"Arguments provided to merge must be objects, not arrays.\");\n\t\tObject.keys(source).forEach((key) => {\n\t\t\tif (UNSAFE_KEYS.has(key)) return;\n\t\t\tconst previous = result[key];\n\t\t\tconst next = source[key];\n\t\t\tif (Array.isArray(previous) && Array.isArray(next)) result[key] = combineArrays(options, previous, next);\n\t\t\telse if (isMergeableObject(previous) && isMergeableObject(next)) result[key] = mergeSources(options, [previous, next]);\n\t\t\telse result[key] = next === void 0 && !options.allowUndefinedOverrides ? previous : next;\n\t\t});\n\t\treturn result;\n\t}, {});\n}\n/**\n* Recursively merges `sources` left to right into a fresh object, skipping keys that would\n* poison `Object.prototype`.\n* @example\n* deepMerge({ branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['main', 'beta'] }\n*/\nfunction deepMerge(...sources) {\n\treturn mergeSources(defaultOptions, sources);\n}\n/**\n* {@link deepMerge} with the merge strategy tuned per call.\n* @example\n* deepMergeWithOptions({ mergeArrays: false }, { branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['beta'] }\n* @param options Only the fields being overridden; every omitted field keeps its default.\n*/\nfunction deepMergeWithOptions(options, ...sources) {\n\treturn mergeSources({\n\t\t...defaultOptions,\n\t\t...options\n\t}, sources);\n}\n//#endregion\nexport { deepMerge, deepMergeWithOptions };\n\n//# sourceMappingURL=index.js.map","// eslint-disable-next-line import-x/no-extraneous-dependencies -- private workspace package, bundled into dist/ at build time; a runtime dependency entry would be unresolvable for consumers\nimport { deepMergeWithOptions } from '@useinsider/utils';\n\nexport function merge<Arguments extends NonNullable<unknown>[]> (...args: Arguments): Arguments[number] {\n return deepMergeWithOptions({ mergeArrays: false }, ...args);\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('merge', () => {\n test('later arguments override earlier ones on overlapping keys', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-console': 'off' } }\n );\n\n expect(result).toStrictEqual({ rules: { 'no-console': 'off' } });\n });\n\n test('precedence holds across three or more arguments', () => {\n const result = merge(\n { rules: { indent: 'off' } },\n { rules: { indent: 'warn' } },\n { rules: { indent: 'error' } }\n );\n\n expect(result).toStrictEqual({ rules: { indent: 'error' } });\n });\n\n test('non-overlapping keys from every argument are preserved', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-debugger': 'warn' } },\n { languageOptions: { ecmaVersion: 2022 } }\n );\n\n expect(result).toStrictEqual({\n rules: {\n 'no-console': 'error',\n 'no-debugger': 'warn',\n },\n languageOptions: { ecmaVersion: 2022 },\n });\n });\n\n test('rule option arrays are replaced wholesale, never concatenated', () => {\n const result = merge(\n { rules: { quotes: ['error', 'double'] } },\n { rules: { quotes: ['error', 'single', { avoidEscape: true }] } }\n );\n\n expect(result).toStrictEqual({\n rules: { quotes: ['error', 'single', { avoidEscape: true }] },\n });\n });\n\n test('files arrays are replaced so a later block fully owns its globs', () => {\n const result = merge(\n { files: ['**/*.js'] },\n { files: ['**/*.ts'] }\n );\n\n expect(result).toStrictEqual({ files: ['**/*.ts'] });\n });\n\n test('deeply nested settings merge key-by-key with later winning', () => {\n const result = merge(\n { settings: { jsdoc: { mode: 'typescript', tagNamePreference: { returns: 'returns' } } } },\n { settings: { jsdoc: { tagNamePreference: { returns: 'return' } } } }\n );\n\n expect(result).toStrictEqual({\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: { returns: 'return' },\n },\n },\n });\n });\n\n test('self-referential plugin objects merge without unbounded recursion', () => {\n const plugin: Record<string, unknown> = { rules: {} };\n\n plugin.configs = { recommended: { plugins: { fake: plugin } } };\n\n const result = merge({}, { plugins: { fake: plugin } }) as { plugins: { fake: unknown } };\n\n expect(result.plugins.fake).toBe(plugin);\n });\n\n test('prototype-polluting keys never reach Object.prototype', () => {\n const payload = JSON.parse('{\"__proto__\":{\"polluted\":true},\"constructor\":{\"polluted\":true}}') as object;\n\n merge({}, payload);\n\n expect(({} as Record<string, unknown>).polluted).toBeUndefined();\n expect(Object.prototype).not.toHaveProperty('polluted');\n });\n\n test('Object.prototype method keys are dropped so the result stays usable as a string', () => {\n const payload = {\n toString: 'not-a-function',\n valueOf: 1,\n hasOwnProperty: null,\n isPrototypeOf: 0,\n propertyIsEnumerable: false,\n toLocaleString: ['nope'],\n };\n\n const result = merge({ rules: { semi: 'error' } }, payload) as Record<string, unknown>;\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n const stringify = () => String(result);\n\n expect(Object.keys(result)).toStrictEqual(['rules']);\n expect(typeof result.toString).toBe('function');\n expect(typeof result.valueOf).toBe('function');\n expect(typeof result.hasOwnProperty).toBe('function');\n expect(stringify).not.toThrow();\n expect(stringify()).toBe('[object Object]');\n });\n\n test('nested Object.prototype method keys are dropped too', () => {\n const result = merge(\n { settings: { shared: { name: 'insider' } } },\n { settings: { shared: { toString: 'not-a-function' } } }\n ) as { settings: { shared: Record<string, unknown> } };\n\n expect(result.settings.shared).toStrictEqual({ name: 'insider' });\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n expect(String(result.settings.shared)).toBe('[object Object]');\n });\n\n test('null-prototype objects are still merged key-by-key', () => {\n const bare = Object.create(null) as Record<string, unknown>;\n\n bare.semi = 'error';\n\n const result = merge({ rules: bare }, { rules: { quotes: 'error' } }) as { rules: unknown };\n\n expect(result.rules).toStrictEqual({ semi: 'error', quotes: 'error' });\n });\n\n test('array arguments are rejected', () => {\n expect(() => merge({}, ['not-an-object'])).toThrow(TypeError);\n });\n });\n}\n"],"mappings":";AACA,IAAI,8BAA8B,IAAI,IAAI;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAI,iBAAiB;CACpB,yBAAyB;CACzB,aAAa;CACb,kBAAkB;AACnB;AACA,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OAAO,cAAc,OAAO,aAAa,cAAc;AACxD;AACA,SAAS,cAAc,SAAS,UAAU,MAAM;CAC/C,IAAI,CAAC,QAAQ,aAAa,OAAO;CACjC,OAAO,QAAQ,mBAAmB,CAAC,mBAAmB,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI;AAC/G;AACA,SAAS,aAAa,SAAS,SAAS;CACvC,OAAO,QAAQ,QAAQ,QAAQ,WAAW;EACzC,IAAI,MAAM,QAAQ,MAAM,GAAG,MAAM,IAAI,UAAU,0DAA0D;EACzG,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,QAAQ;GACpC,IAAI,YAAY,IAAI,GAAG,GAAG;GAC1B,MAAM,WAAW,OAAO;GACxB,MAAM,OAAO,OAAO;GACpB,IAAI,MAAM,QAAQ,QAAQ,KAAK,MAAM,QAAQ,IAAI,GAAG,OAAO,OAAO,cAAc,SAAS,UAAU,IAAI;QAClG,IAAI,kBAAkB,QAAQ,KAAK,kBAAkB,IAAI,GAAG,OAAO,OAAO,aAAa,SAAS,CAAC,UAAU,IAAI,CAAC;QAChH,OAAO,OAAO,SAAS,KAAK,KAAK,CAAC,QAAQ,0BAA0B,WAAW;EACrF,CAAC;EACD,OAAO;CACR,GAAG,CAAC,CAAC;AACN;;;;;;;;AAkBA,SAAS,qBAAqB,SAAS,GAAG,SAAS;CAClD,OAAO,aAAa;EACnB,GAAG;EACH,GAAG;CACJ,GAAG,OAAO;AACX;;;AC3DA,SAAgB,MAAiD,GAAG,MAAe;CAC/E,OAAO,qBAAqB,EAAE,aAAa,MAAK,GAAI,GAAG,IAAI;AAC/D"}
|
|
1
|
+
{"version":3,"file":"merge-DJQU2y2U.cjs","names":[],"sources":["../../utils/dist/index.js","../src/utils/merge.ts"],"sourcesContent":["//#region src/merge.ts\nvar UNSAFE_KEYS = /* @__PURE__ */ new Set([\n\t\"__proto__\",\n\t\"constructor\",\n\t\"prototype\",\n\t\"toString\",\n\t\"valueOf\",\n\t\"hasOwnProperty\",\n\t\"isPrototypeOf\",\n\t\"propertyIsEnumerable\",\n\t\"toLocaleString\"\n]);\nvar defaultOptions = {\n\tallowUndefinedOverrides: true,\n\tmergeArrays: true,\n\tuniqueArrayItems: true\n};\nfunction isMergeableObject(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction combineArrays(options, previous, next) {\n\tif (!options.mergeArrays) return next;\n\treturn options.uniqueArrayItems ? [.../* @__PURE__ */ new Set([...previous, ...next])] : [...previous, ...next];\n}\nfunction mergeSources(options, sources) {\n\treturn sources.reduce((result, source) => {\n\t\tif (Array.isArray(source)) throw new TypeError(\"Arguments provided to merge must be objects, not arrays.\");\n\t\tObject.keys(source).forEach((key) => {\n\t\t\tif (UNSAFE_KEYS.has(key)) return;\n\t\t\tconst previous = result[key];\n\t\t\tconst next = source[key];\n\t\t\tif (Array.isArray(previous) && Array.isArray(next)) result[key] = combineArrays(options, previous, next);\n\t\t\telse if (isMergeableObject(previous) && isMergeableObject(next)) result[key] = mergeSources(options, [previous, next]);\n\t\t\telse result[key] = next === void 0 && !options.allowUndefinedOverrides ? previous : next;\n\t\t});\n\t\treturn result;\n\t}, {});\n}\n/**\n* Recursively merges `sources` left to right into a fresh object, skipping keys that would\n* poison `Object.prototype`.\n* @example\n* deepMerge({ branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['main', 'beta'] }\n*/\nfunction deepMerge(...sources) {\n\treturn mergeSources(defaultOptions, sources);\n}\n/**\n* {@link deepMerge} with the merge strategy tuned per call.\n* @example\n* deepMergeWithOptions({ mergeArrays: false }, { branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['beta'] }\n* @param options Only the fields being overridden; every omitted field keeps its default.\n*/\nfunction deepMergeWithOptions(options, ...sources) {\n\treturn mergeSources({\n\t\t...defaultOptions,\n\t\t...options\n\t}, sources);\n}\n//#endregion\nexport { deepMerge, deepMergeWithOptions };\n\n//# sourceMappingURL=index.js.map","// eslint-disable-next-line import-x/no-extraneous-dependencies -- restricted-access workspace package, bundled into dist/ at build time; a runtime dependency entry would be uninstallable for public consumers\nimport { deepMergeWithOptions, type MergeSource } from '@useinsider/config-utils';\n\n// Not DeepMerged: on the Linter.Config presets it hits TS2589 (instantiations 21k -> 9.6M). Not MergeSource:\n// the public .d.ts would import the restricted config-utils package, which consumers cannot install.\nexport function merge<Arguments extends NonNullable<unknown>[]> (...args: Arguments): Arguments[number] {\n return deepMergeWithOptions({ mergeArrays: false }, ...(args as MergeSource[]));\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('merge', () => {\n test('later arguments override earlier ones on overlapping keys', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-console': 'off' } }\n );\n\n expect(result).toStrictEqual({ rules: { 'no-console': 'off' } });\n });\n\n test('precedence holds across three or more arguments', () => {\n const result = merge(\n { rules: { indent: 'off' } },\n { rules: { indent: 'warn' } },\n { rules: { indent: 'error' } }\n );\n\n expect(result).toStrictEqual({ rules: { indent: 'error' } });\n });\n\n test('non-overlapping keys from every argument are preserved', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-debugger': 'warn' } },\n { languageOptions: { ecmaVersion: 2022 } }\n );\n\n expect(result).toStrictEqual({\n rules: {\n 'no-console': 'error',\n 'no-debugger': 'warn',\n },\n languageOptions: { ecmaVersion: 2022 },\n });\n });\n\n test('rule option arrays are replaced wholesale, never concatenated', () => {\n const result = merge(\n { rules: { quotes: ['error', 'double'] } },\n { rules: { quotes: ['error', 'single', { avoidEscape: true }] } }\n );\n\n expect(result).toStrictEqual({\n rules: { quotes: ['error', 'single', { avoidEscape: true }] },\n });\n });\n\n test('files arrays are replaced so a later block fully owns its globs', () => {\n const result = merge(\n { files: ['**/*.js'] },\n { files: ['**/*.ts'] }\n );\n\n expect(result).toStrictEqual({ files: ['**/*.ts'] });\n });\n\n test('deeply nested settings merge key-by-key with later winning', () => {\n const result = merge(\n { settings: { jsdoc: { mode: 'typescript', tagNamePreference: { returns: 'returns' } } } },\n { settings: { jsdoc: { tagNamePreference: { returns: 'return' } } } }\n );\n\n expect(result).toStrictEqual({\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: { returns: 'return' },\n },\n },\n });\n });\n\n test('self-referential plugin objects merge without unbounded recursion', () => {\n const plugin: Record<string, unknown> = { rules: {} };\n\n plugin.configs = { recommended: { plugins: { fake: plugin } } };\n\n const result = merge({}, { plugins: { fake: plugin } }) as { plugins: { fake: unknown } };\n\n expect(result.plugins.fake).toBe(plugin);\n });\n\n test('prototype-polluting keys never reach Object.prototype', () => {\n const payload = JSON.parse('{\"__proto__\":{\"polluted\":true},\"constructor\":{\"polluted\":true}}') as object;\n\n merge({}, payload);\n\n expect(({} as Record<string, unknown>).polluted).toBeUndefined();\n expect(Object.prototype).not.toHaveProperty('polluted');\n });\n\n test('Object.prototype method keys are dropped so the result stays usable as a string', () => {\n const payload = {\n toString: 'not-a-function',\n valueOf: 1,\n hasOwnProperty: null,\n isPrototypeOf: 0,\n propertyIsEnumerable: false,\n toLocaleString: ['nope'],\n };\n\n const result = merge({ rules: { semi: 'error' } }, payload) as Record<string, unknown>;\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n const stringify = () => String(result);\n\n expect(Object.keys(result)).toStrictEqual(['rules']);\n expect(typeof result.toString).toBe('function');\n expect(typeof result.valueOf).toBe('function');\n expect(typeof result.hasOwnProperty).toBe('function');\n expect(stringify).not.toThrow();\n expect(stringify()).toBe('[object Object]');\n });\n\n test('nested Object.prototype method keys are dropped too', () => {\n const result = merge(\n { settings: { shared: { name: 'insider' } } },\n { settings: { shared: { toString: 'not-a-function' } } }\n ) as { settings: { shared: Record<string, unknown> } };\n\n expect(result.settings.shared).toStrictEqual({ name: 'insider' });\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n expect(String(result.settings.shared)).toBe('[object Object]');\n });\n\n test('null-prototype objects are still merged key-by-key', () => {\n const bare = Object.create(null) as Record<string, unknown>;\n\n bare.semi = 'error';\n\n const result = merge({ rules: bare }, { rules: { quotes: 'error' } }) as { rules: unknown };\n\n expect(result.rules).toStrictEqual({ semi: 'error', quotes: 'error' });\n });\n\n test('array arguments are rejected', () => {\n expect(() => merge({}, ['not-an-object'])).toThrow(TypeError);\n });\n });\n}\n"],"mappings":";AACA,IAAI,8BAA8B,IAAI,IAAI;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAI,iBAAiB;CACpB,yBAAyB;CACzB,aAAa;CACb,kBAAkB;AACnB;AACA,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OAAO,cAAc,OAAO,aAAa,cAAc;AACxD;AACA,SAAS,cAAc,SAAS,UAAU,MAAM;CAC/C,IAAI,CAAC,QAAQ,aAAa,OAAO;CACjC,OAAO,QAAQ,mBAAmB,CAAC,mBAAmB,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI;AAC/G;AACA,SAAS,aAAa,SAAS,SAAS;CACvC,OAAO,QAAQ,QAAQ,QAAQ,WAAW;EACzC,IAAI,MAAM,QAAQ,MAAM,GAAG,MAAM,IAAI,UAAU,0DAA0D;EACzG,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,QAAQ;GACpC,IAAI,YAAY,IAAI,GAAG,GAAG;GAC1B,MAAM,WAAW,OAAO;GACxB,MAAM,OAAO,OAAO;GACpB,IAAI,MAAM,QAAQ,QAAQ,KAAK,MAAM,QAAQ,IAAI,GAAG,OAAO,OAAO,cAAc,SAAS,UAAU,IAAI;QAClG,IAAI,kBAAkB,QAAQ,KAAK,kBAAkB,IAAI,GAAG,OAAO,OAAO,aAAa,SAAS,CAAC,UAAU,IAAI,CAAC;QAChH,OAAO,OAAO,SAAS,KAAK,KAAK,CAAC,QAAQ,0BAA0B,WAAW;EACrF,CAAC;EACD,OAAO;CACR,GAAG,CAAC,CAAC;AACN;;;;;;;;AAkBA,SAAS,qBAAqB,SAAS,GAAG,SAAS;CAClD,OAAO,aAAa;EACnB,GAAG;EACH,GAAG;CACJ,GAAG,OAAO;AACX;;;ACzDA,SAAgB,MAAiD,GAAG,MAAe;CAC/E,OAAO,qBAAqB,EAAE,aAAa,MAAK,GAAI,GAAI,IAAsB;AAClF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-R5ZHqMsV.js","names":[],"sources":["../../utils/dist/index.js","../src/utils/merge.ts"],"sourcesContent":["//#region src/merge.ts\nvar UNSAFE_KEYS = /* @__PURE__ */ new Set([\n\t\"__proto__\",\n\t\"constructor\",\n\t\"prototype\",\n\t\"toString\",\n\t\"valueOf\",\n\t\"hasOwnProperty\",\n\t\"isPrototypeOf\",\n\t\"propertyIsEnumerable\",\n\t\"toLocaleString\"\n]);\nvar defaultOptions = {\n\tallowUndefinedOverrides: true,\n\tmergeArrays: true,\n\tuniqueArrayItems: true\n};\nfunction isMergeableObject(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction combineArrays(options, previous, next) {\n\tif (!options.mergeArrays) return next;\n\treturn options.uniqueArrayItems ? [.../* @__PURE__ */ new Set([...previous, ...next])] : [...previous, ...next];\n}\nfunction mergeSources(options, sources) {\n\treturn sources.reduce((result, source) => {\n\t\tif (Array.isArray(source)) throw new TypeError(\"Arguments provided to merge must be objects, not arrays.\");\n\t\tObject.keys(source).forEach((key) => {\n\t\t\tif (UNSAFE_KEYS.has(key)) return;\n\t\t\tconst previous = result[key];\n\t\t\tconst next = source[key];\n\t\t\tif (Array.isArray(previous) && Array.isArray(next)) result[key] = combineArrays(options, previous, next);\n\t\t\telse if (isMergeableObject(previous) && isMergeableObject(next)) result[key] = mergeSources(options, [previous, next]);\n\t\t\telse result[key] = next === void 0 && !options.allowUndefinedOverrides ? previous : next;\n\t\t});\n\t\treturn result;\n\t}, {});\n}\n/**\n* Recursively merges `sources` left to right into a fresh object, skipping keys that would\n* poison `Object.prototype`.\n* @example\n* deepMerge({ branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['main', 'beta'] }\n*/\nfunction deepMerge(...sources) {\n\treturn mergeSources(defaultOptions, sources);\n}\n/**\n* {@link deepMerge} with the merge strategy tuned per call.\n* @example\n* deepMergeWithOptions({ mergeArrays: false }, { branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['beta'] }\n* @param options Only the fields being overridden; every omitted field keeps its default.\n*/\nfunction deepMergeWithOptions(options, ...sources) {\n\treturn mergeSources({\n\t\t...defaultOptions,\n\t\t...options\n\t}, sources);\n}\n//#endregion\nexport { deepMerge, deepMergeWithOptions };\n\n//# sourceMappingURL=index.js.map","// eslint-disable-next-line import-x/no-extraneous-dependencies -- private workspace package, bundled into dist/ at build time; a runtime dependency entry would be unresolvable for consumers\nimport { deepMergeWithOptions } from '@useinsider/utils';\n\nexport function merge<Arguments extends NonNullable<unknown>[]> (...args: Arguments): Arguments[number] {\n return deepMergeWithOptions({ mergeArrays: false }, ...args);\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('merge', () => {\n test('later arguments override earlier ones on overlapping keys', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-console': 'off' } }\n );\n\n expect(result).toStrictEqual({ rules: { 'no-console': 'off' } });\n });\n\n test('precedence holds across three or more arguments', () => {\n const result = merge(\n { rules: { indent: 'off' } },\n { rules: { indent: 'warn' } },\n { rules: { indent: 'error' } }\n );\n\n expect(result).toStrictEqual({ rules: { indent: 'error' } });\n });\n\n test('non-overlapping keys from every argument are preserved', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-debugger': 'warn' } },\n { languageOptions: { ecmaVersion: 2022 } }\n );\n\n expect(result).toStrictEqual({\n rules: {\n 'no-console': 'error',\n 'no-debugger': 'warn',\n },\n languageOptions: { ecmaVersion: 2022 },\n });\n });\n\n test('rule option arrays are replaced wholesale, never concatenated', () => {\n const result = merge(\n { rules: { quotes: ['error', 'double'] } },\n { rules: { quotes: ['error', 'single', { avoidEscape: true }] } }\n );\n\n expect(result).toStrictEqual({\n rules: { quotes: ['error', 'single', { avoidEscape: true }] },\n });\n });\n\n test('files arrays are replaced so a later block fully owns its globs', () => {\n const result = merge(\n { files: ['**/*.js'] },\n { files: ['**/*.ts'] }\n );\n\n expect(result).toStrictEqual({ files: ['**/*.ts'] });\n });\n\n test('deeply nested settings merge key-by-key with later winning', () => {\n const result = merge(\n { settings: { jsdoc: { mode: 'typescript', tagNamePreference: { returns: 'returns' } } } },\n { settings: { jsdoc: { tagNamePreference: { returns: 'return' } } } }\n );\n\n expect(result).toStrictEqual({\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: { returns: 'return' },\n },\n },\n });\n });\n\n test('self-referential plugin objects merge without unbounded recursion', () => {\n const plugin: Record<string, unknown> = { rules: {} };\n\n plugin.configs = { recommended: { plugins: { fake: plugin } } };\n\n const result = merge({}, { plugins: { fake: plugin } }) as { plugins: { fake: unknown } };\n\n expect(result.plugins.fake).toBe(plugin);\n });\n\n test('prototype-polluting keys never reach Object.prototype', () => {\n const payload = JSON.parse('{\"__proto__\":{\"polluted\":true},\"constructor\":{\"polluted\":true}}') as object;\n\n merge({}, payload);\n\n expect(({} as Record<string, unknown>).polluted).toBeUndefined();\n expect(Object.prototype).not.toHaveProperty('polluted');\n });\n\n test('Object.prototype method keys are dropped so the result stays usable as a string', () => {\n const payload = {\n toString: 'not-a-function',\n valueOf: 1,\n hasOwnProperty: null,\n isPrototypeOf: 0,\n propertyIsEnumerable: false,\n toLocaleString: ['nope'],\n };\n\n const result = merge({ rules: { semi: 'error' } }, payload) as Record<string, unknown>;\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n const stringify = () => String(result);\n\n expect(Object.keys(result)).toStrictEqual(['rules']);\n expect(typeof result.toString).toBe('function');\n expect(typeof result.valueOf).toBe('function');\n expect(typeof result.hasOwnProperty).toBe('function');\n expect(stringify).not.toThrow();\n expect(stringify()).toBe('[object Object]');\n });\n\n test('nested Object.prototype method keys are dropped too', () => {\n const result = merge(\n { settings: { shared: { name: 'insider' } } },\n { settings: { shared: { toString: 'not-a-function' } } }\n ) as { settings: { shared: Record<string, unknown> } };\n\n expect(result.settings.shared).toStrictEqual({ name: 'insider' });\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n expect(String(result.settings.shared)).toBe('[object Object]');\n });\n\n test('null-prototype objects are still merged key-by-key', () => {\n const bare = Object.create(null) as Record<string, unknown>;\n\n bare.semi = 'error';\n\n const result = merge({ rules: bare }, { rules: { quotes: 'error' } }) as { rules: unknown };\n\n expect(result.rules).toStrictEqual({ semi: 'error', quotes: 'error' });\n });\n\n test('array arguments are rejected', () => {\n expect(() => merge({}, ['not-an-object'])).toThrow(TypeError);\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X;;;AC3DA,SAAgB,MAAiD,GAAG,MAAe;CAC/E,OAAO,qBAAqB,EAAE,aAAa,MAAK,GAAI,GAAG,IAAI;AAC/D"}
|
|
1
|
+
{"version":3,"file":"merge-R5ZHqMsV.js","names":[],"sources":["../../utils/dist/index.js","../src/utils/merge.ts"],"sourcesContent":["//#region src/merge.ts\nvar UNSAFE_KEYS = /* @__PURE__ */ new Set([\n\t\"__proto__\",\n\t\"constructor\",\n\t\"prototype\",\n\t\"toString\",\n\t\"valueOf\",\n\t\"hasOwnProperty\",\n\t\"isPrototypeOf\",\n\t\"propertyIsEnumerable\",\n\t\"toLocaleString\"\n]);\nvar defaultOptions = {\n\tallowUndefinedOverrides: true,\n\tmergeArrays: true,\n\tuniqueArrayItems: true\n};\nfunction isMergeableObject(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction combineArrays(options, previous, next) {\n\tif (!options.mergeArrays) return next;\n\treturn options.uniqueArrayItems ? [.../* @__PURE__ */ new Set([...previous, ...next])] : [...previous, ...next];\n}\nfunction mergeSources(options, sources) {\n\treturn sources.reduce((result, source) => {\n\t\tif (Array.isArray(source)) throw new TypeError(\"Arguments provided to merge must be objects, not arrays.\");\n\t\tObject.keys(source).forEach((key) => {\n\t\t\tif (UNSAFE_KEYS.has(key)) return;\n\t\t\tconst previous = result[key];\n\t\t\tconst next = source[key];\n\t\t\tif (Array.isArray(previous) && Array.isArray(next)) result[key] = combineArrays(options, previous, next);\n\t\t\telse if (isMergeableObject(previous) && isMergeableObject(next)) result[key] = mergeSources(options, [previous, next]);\n\t\t\telse result[key] = next === void 0 && !options.allowUndefinedOverrides ? previous : next;\n\t\t});\n\t\treturn result;\n\t}, {});\n}\n/**\n* Recursively merges `sources` left to right into a fresh object, skipping keys that would\n* poison `Object.prototype`.\n* @example\n* deepMerge({ branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['main', 'beta'] }\n*/\nfunction deepMerge(...sources) {\n\treturn mergeSources(defaultOptions, sources);\n}\n/**\n* {@link deepMerge} with the merge strategy tuned per call.\n* @example\n* deepMergeWithOptions({ mergeArrays: false }, { branches: ['main'] }, { branches: ['beta'] });\n* // => { branches: ['beta'] }\n* @param options Only the fields being overridden; every omitted field keeps its default.\n*/\nfunction deepMergeWithOptions(options, ...sources) {\n\treturn mergeSources({\n\t\t...defaultOptions,\n\t\t...options\n\t}, sources);\n}\n//#endregion\nexport { deepMerge, deepMergeWithOptions };\n\n//# sourceMappingURL=index.js.map","// eslint-disable-next-line import-x/no-extraneous-dependencies -- restricted-access workspace package, bundled into dist/ at build time; a runtime dependency entry would be uninstallable for public consumers\nimport { deepMergeWithOptions, type MergeSource } from '@useinsider/config-utils';\n\n// Not DeepMerged: on the Linter.Config presets it hits TS2589 (instantiations 21k -> 9.6M). Not MergeSource:\n// the public .d.ts would import the restricted config-utils package, which consumers cannot install.\nexport function merge<Arguments extends NonNullable<unknown>[]> (...args: Arguments): Arguments[number] {\n return deepMergeWithOptions({ mergeArrays: false }, ...(args as MergeSource[]));\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('merge', () => {\n test('later arguments override earlier ones on overlapping keys', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-console': 'off' } }\n );\n\n expect(result).toStrictEqual({ rules: { 'no-console': 'off' } });\n });\n\n test('precedence holds across three or more arguments', () => {\n const result = merge(\n { rules: { indent: 'off' } },\n { rules: { indent: 'warn' } },\n { rules: { indent: 'error' } }\n );\n\n expect(result).toStrictEqual({ rules: { indent: 'error' } });\n });\n\n test('non-overlapping keys from every argument are preserved', () => {\n const result = merge(\n { rules: { 'no-console': 'error' } },\n { rules: { 'no-debugger': 'warn' } },\n { languageOptions: { ecmaVersion: 2022 } }\n );\n\n expect(result).toStrictEqual({\n rules: {\n 'no-console': 'error',\n 'no-debugger': 'warn',\n },\n languageOptions: { ecmaVersion: 2022 },\n });\n });\n\n test('rule option arrays are replaced wholesale, never concatenated', () => {\n const result = merge(\n { rules: { quotes: ['error', 'double'] } },\n { rules: { quotes: ['error', 'single', { avoidEscape: true }] } }\n );\n\n expect(result).toStrictEqual({\n rules: { quotes: ['error', 'single', { avoidEscape: true }] },\n });\n });\n\n test('files arrays are replaced so a later block fully owns its globs', () => {\n const result = merge(\n { files: ['**/*.js'] },\n { files: ['**/*.ts'] }\n );\n\n expect(result).toStrictEqual({ files: ['**/*.ts'] });\n });\n\n test('deeply nested settings merge key-by-key with later winning', () => {\n const result = merge(\n { settings: { jsdoc: { mode: 'typescript', tagNamePreference: { returns: 'returns' } } } },\n { settings: { jsdoc: { tagNamePreference: { returns: 'return' } } } }\n );\n\n expect(result).toStrictEqual({\n settings: {\n jsdoc: {\n mode: 'typescript',\n tagNamePreference: { returns: 'return' },\n },\n },\n });\n });\n\n test('self-referential plugin objects merge without unbounded recursion', () => {\n const plugin: Record<string, unknown> = { rules: {} };\n\n plugin.configs = { recommended: { plugins: { fake: plugin } } };\n\n const result = merge({}, { plugins: { fake: plugin } }) as { plugins: { fake: unknown } };\n\n expect(result.plugins.fake).toBe(plugin);\n });\n\n test('prototype-polluting keys never reach Object.prototype', () => {\n const payload = JSON.parse('{\"__proto__\":{\"polluted\":true},\"constructor\":{\"polluted\":true}}') as object;\n\n merge({}, payload);\n\n expect(({} as Record<string, unknown>).polluted).toBeUndefined();\n expect(Object.prototype).not.toHaveProperty('polluted');\n });\n\n test('Object.prototype method keys are dropped so the result stays usable as a string', () => {\n const payload = {\n toString: 'not-a-function',\n valueOf: 1,\n hasOwnProperty: null,\n isPrototypeOf: 0,\n propertyIsEnumerable: false,\n toLocaleString: ['nope'],\n };\n\n const result = merge({ rules: { semi: 'error' } }, payload) as Record<string, unknown>;\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n const stringify = () => String(result);\n\n expect(Object.keys(result)).toStrictEqual(['rules']);\n expect(typeof result.toString).toBe('function');\n expect(typeof result.valueOf).toBe('function');\n expect(typeof result.hasOwnProperty).toBe('function');\n expect(stringify).not.toThrow();\n expect(stringify()).toBe('[object Object]');\n });\n\n test('nested Object.prototype method keys are dropped too', () => {\n const result = merge(\n { settings: { shared: { name: 'insider' } } },\n { settings: { shared: { toString: 'not-a-function' } } }\n ) as { settings: { shared: Record<string, unknown> } };\n\n expect(result.settings.shared).toStrictEqual({ name: 'insider' });\n // eslint-disable-next-line @typescript-eslint/no-base-to-string -- default stringification is exactly what this CVE regression asserts\n expect(String(result.settings.shared)).toBe('[object Object]');\n });\n\n test('null-prototype objects are still merged key-by-key', () => {\n const bare = Object.create(null) as Record<string, unknown>;\n\n bare.semi = 'error';\n\n const result = merge({ rules: bare }, { rules: { quotes: 'error' } }) as { rules: unknown };\n\n expect(result.rules).toStrictEqual({ semi: 'error', quotes: 'error' });\n });\n\n test('array arguments are rejected', () => {\n expect(() => merge({}, ['not-an-object'])).toThrow(TypeError);\n });\n });\n}\n"],"mappings":";AACA,IAAI,8BAA8B,IAAI,IAAI;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAI,iBAAiB;CACpB,yBAAyB;CACzB,aAAa;CACb,kBAAkB;AACnB;AACA,SAAS,kBAAkB,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OAAO,cAAc,OAAO,aAAa,cAAc;AACxD;AACA,SAAS,cAAc,SAAS,UAAU,MAAM;CAC/C,IAAI,CAAC,QAAQ,aAAa,OAAO;CACjC,OAAO,QAAQ,mBAAmB,CAAC,mBAAmB,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI;AAC/G;AACA,SAAS,aAAa,SAAS,SAAS;CACvC,OAAO,QAAQ,QAAQ,QAAQ,WAAW;EACzC,IAAI,MAAM,QAAQ,MAAM,GAAG,MAAM,IAAI,UAAU,0DAA0D;EACzG,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,QAAQ;GACpC,IAAI,YAAY,IAAI,GAAG,GAAG;GAC1B,MAAM,WAAW,OAAO;GACxB,MAAM,OAAO,OAAO;GACpB,IAAI,MAAM,QAAQ,QAAQ,KAAK,MAAM,QAAQ,IAAI,GAAG,OAAO,OAAO,cAAc,SAAS,UAAU,IAAI;QAClG,IAAI,kBAAkB,QAAQ,KAAK,kBAAkB,IAAI,GAAG,OAAO,OAAO,aAAa,SAAS,CAAC,UAAU,IAAI,CAAC;QAChH,OAAO,OAAO,SAAS,KAAK,KAAK,CAAC,QAAQ,0BAA0B,WAAW;EACrF,CAAC;EACD,OAAO;CACR,GAAG,CAAC,CAAC;AACN;;;;;;;;AAkBA,SAAS,qBAAqB,SAAS,GAAG,SAAS;CAClD,OAAO,aAAa;EACnB,GAAG;EACH,GAAG;CACJ,GAAG,OAAO;AACX;;;ACzDA,SAAgB,MAAiD,GAAG,MAAe;CAC/E,OAAO,qBAAqB,EAAE,aAAa,MAAK,GAAI,GAAI,IAAsB;AAClF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const require_merge = require("./merge-DJQU2y2U.cjs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
//#region src/utils/mergeAllConfig.ts
|
|
4
|
+
function mergeAll(...configs) {
|
|
5
|
+
return configs.flat().reduce((acc, scope) => require_merge.merge(acc, scope), {});
|
|
6
|
+
}
|
|
7
|
+
function matchesPattern(filePath, pattern) {
|
|
8
|
+
return Array.isArray(pattern) ? pattern.every((part) => (0, node_path.matchesGlob)(filePath, part)) : (0, node_path.matchesGlob)(filePath, pattern);
|
|
9
|
+
}
|
|
10
|
+
function appliesTo(block, targetFiles) {
|
|
11
|
+
return !block.files || block.files.some((pattern) => targetFiles.some((file) => matchesPattern(file, pattern)));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Folds config blocks into one, like `mergeAll`, but skips every block whose `files` matches none of
|
|
15
|
+
* `targetFiles`, so a block an upstream preset scopes to other file types cannot leak into the result.
|
|
16
|
+
* @example
|
|
17
|
+
* mergeAllFor(['file.ts'], [
|
|
18
|
+
* { files: ['**\/*.ts'], rules: { 'dot-notation': 'off' } },
|
|
19
|
+
* { files: ['**\/*.js'], rules: { 'no-var': 'off' } },
|
|
20
|
+
* ]); // { files: ['**\/*.ts'], rules: { 'dot-notation': 'off' } }
|
|
21
|
+
*/
|
|
22
|
+
function mergeAllFor(targetFiles, ...configs) {
|
|
23
|
+
return mergeAll(configs.flat().filter((block) => appliesTo(block, targetFiles)));
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
Object.defineProperty(exports, "mergeAll", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return mergeAll;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "mergeAllFor", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function() {
|
|
35
|
+
return mergeAllFor;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=mergeAllConfig-CqddZ81h.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeAllConfig-CqddZ81h.cjs","names":["merge","matchesGlob"],"sources":["../src/utils/mergeAllConfig.ts"],"sourcesContent":["import { matchesGlob } from 'node:path';\nimport type { Linter } from 'eslint';\nimport { merge } from './merge';\n\nexport function mergeAll (...configs: Linter.Config[][]) {\n return configs.flat().reduce((acc, scope) => merge(acc, scope), {} as Linter.Config);\n}\n\nfunction matchesPattern (filePath: string, pattern: string | string[]): boolean {\n return Array.isArray(pattern)\n ? pattern.every(part => matchesGlob(filePath, part))\n : matchesGlob(filePath, pattern);\n}\n\nfunction appliesTo (block: Linter.Config, targetFiles: readonly string[]): boolean {\n return !block.files || block.files.some(pattern => targetFiles.some(file => matchesPattern(file, pattern)));\n}\n\n/**\n * Folds config blocks into one, like `mergeAll`, but skips every block whose `files` matches none of\n * `targetFiles`, so a block an upstream preset scopes to other file types cannot leak into the result.\n * @example\n * mergeAllFor(['file.ts'], [\n * { files: ['**\\/*.ts'], rules: { 'dot-notation': 'off' } },\n * { files: ['**\\/*.js'], rules: { 'no-var': 'off' } },\n * ]); // { files: ['**\\/*.ts'], rules: { 'dot-notation': 'off' } }\n */\nexport function mergeAllFor (targetFiles: readonly string[], ...configs: Linter.Config[][]) {\n return mergeAll(configs.flat().filter(block => appliesTo(block, targetFiles)));\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('mergeAll', () => {\n test('flattens every config array into a single block', () => {\n const result = mergeAll(\n [{ rules: { 'no-console': 'error' } }],\n [{ rules: { 'no-debugger': 'warn' } }]\n );\n\n expect(result).toStrictEqual({\n rules: {\n 'no-console': 'error',\n 'no-debugger': 'warn',\n },\n });\n });\n\n test('later arrays override earlier ones on overlapping rules', () => {\n const result = mergeAll(\n [{ rules: { semi: 'off' } }],\n [{ rules: { semi: 'error' } }]\n );\n\n expect(result.rules).toStrictEqual({ semi: 'error' });\n });\n\n test('later entries within one array override earlier entries', () => {\n const result = mergeAll([\n { rules: { semi: 'off' } },\n { rules: { semi: 'error' } },\n ]);\n\n expect(result.rules).toStrictEqual({ semi: 'error' });\n });\n\n test('does not mutate the caller-supplied config blocks', () => {\n const first: Linter.Config = { rules: { semi: 'off' } };\n const second: Linter.Config = { rules: { semi: 'error' } };\n\n mergeAll([first], [second]);\n\n expect(first.rules).toStrictEqual({ semi: 'off' });\n expect(second.rules).toStrictEqual({ semi: 'error' });\n });\n\n test('returns an empty config when given no blocks', () => {\n expect(mergeAll([])).toStrictEqual({});\n });\n });\n\n describe('mergeAllFor', () => {\n const javascriptOnly: Linter.Config = { files: ['**/*.js', '**/*.mjs'], rules: { 'no-var': 'off' } };\n const typescriptOnly: Linter.Config = { files: ['**/*.ts'], rules: { semi: 'off' } };\n const unscoped: Linter.Config = { rules: { 'no-console': 'error' } };\n\n test('keeps unscoped blocks and blocks whose files match a target', () => {\n const result = mergeAllFor(['file.ts'], [unscoped, javascriptOnly, typescriptOnly]);\n\n expect(result.rules).toStrictEqual({ 'no-console': 'error', semi: 'off' });\n });\n\n test('skips a block scoped only to other file types', () => {\n const result = mergeAllFor(['file.ts'], [javascriptOnly]);\n\n expect(result).toStrictEqual({});\n });\n\n test('keeps a block when any target matches', () => {\n const result = mergeAllFor(['file.vue', 'file.js'], [javascriptOnly, typescriptOnly]);\n\n expect(result.rules).toStrictEqual({ 'no-var': 'off' });\n });\n\n test('treats a nested pattern array as every part having to match', () => {\n const nested: Linter.Config = { files: [['**/*.ts', 'src/**']], rules: { semi: 'error' } };\n\n expect(mergeAllFor(['src/file.ts'], [nested]).rules).toStrictEqual({ semi: 'error' });\n expect(mergeAllFor(['file.ts'], [nested])).toStrictEqual({});\n });\n\n test('merges matching blocks across arrays in order', () => {\n const result = mergeAllFor(\n ['file.ts'],\n [{ rules: { semi: 'off' } }],\n [{ files: ['**/*.ts'], rules: { semi: 'error' } }]\n );\n\n expect(result.rules).toStrictEqual({ semi: 'error' });\n });\n });\n}\n"],"mappings":";;;AAIA,SAAgB,SAAU,GAAG,SAA0B;CACnD,OAAO,QAAQ,KAAI,CAAE,CAAC,QAAQ,KAAK,UAAUA,cAAAA,MAAM,KAAK,KAAK,GAAG,CAAA,CAAmB;AACvF;AAEA,SAAS,eAAgB,UAAkB,SAA0B;CACjE,OAAO,MAAM,QAAQ,OAAO,IACtB,QAAQ,OAAM,UAAA,GAAQC,UAAAA,YAAAA,CAAY,UAAU,IAAI,CAAC,KAAA,GACjDA,UAAAA,YAAAA,CAAY,UAAU,OAAO;AACvC;AAEA,SAAS,UAAW,OAAsB,aAA8B;CACpE,OAAO,CAAC,MAAM,SAAS,MAAM,MAAM,MAAK,YAAW,YAAY,MAAK,SAAQ,eAAe,MAAM,OAAO,CAAC,CAAC;AAC9G;;;;;;;;;;AAWA,SAAgB,YAAa,aAAgC,GAAG,SAA0B;CACtF,OAAO,SAAS,QAAQ,KAAI,CAAE,CAAC,QAAO,UAAS,UAAU,OAAO,WAAW,CAAC,CAAC;AACjF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { t as merge } from "./merge-R5ZHqMsV.js";
|
|
2
|
+
import { matchesGlob } from "node:path";
|
|
3
|
+
//#region src/utils/mergeAllConfig.ts
|
|
4
|
+
function mergeAll(...configs) {
|
|
5
|
+
return configs.flat().reduce((acc, scope) => merge(acc, scope), {});
|
|
6
|
+
}
|
|
7
|
+
function matchesPattern(filePath, pattern) {
|
|
8
|
+
return Array.isArray(pattern) ? pattern.every((part) => matchesGlob(filePath, part)) : matchesGlob(filePath, pattern);
|
|
9
|
+
}
|
|
10
|
+
function appliesTo(block, targetFiles) {
|
|
11
|
+
return !block.files || block.files.some((pattern) => targetFiles.some((file) => matchesPattern(file, pattern)));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Folds config blocks into one, like `mergeAll`, but skips every block whose `files` matches none of
|
|
15
|
+
* `targetFiles`, so a block an upstream preset scopes to other file types cannot leak into the result.
|
|
16
|
+
* @example
|
|
17
|
+
* mergeAllFor(['file.ts'], [
|
|
18
|
+
* { files: ['**\/*.ts'], rules: { 'dot-notation': 'off' } },
|
|
19
|
+
* { files: ['**\/*.js'], rules: { 'no-var': 'off' } },
|
|
20
|
+
* ]); // { files: ['**\/*.ts'], rules: { 'dot-notation': 'off' } }
|
|
21
|
+
*/
|
|
22
|
+
function mergeAllFor(targetFiles, ...configs) {
|
|
23
|
+
return mergeAll(configs.flat().filter((block) => appliesTo(block, targetFiles)));
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { mergeAllFor as n, mergeAll as t };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=mergeAllConfig-D0OcACtk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeAllConfig-D0OcACtk.js","names":[],"sources":["../src/utils/mergeAllConfig.ts"],"sourcesContent":["import { matchesGlob } from 'node:path';\nimport type { Linter } from 'eslint';\nimport { merge } from './merge';\n\nexport function mergeAll (...configs: Linter.Config[][]) {\n return configs.flat().reduce((acc, scope) => merge(acc, scope), {} as Linter.Config);\n}\n\nfunction matchesPattern (filePath: string, pattern: string | string[]): boolean {\n return Array.isArray(pattern)\n ? pattern.every(part => matchesGlob(filePath, part))\n : matchesGlob(filePath, pattern);\n}\n\nfunction appliesTo (block: Linter.Config, targetFiles: readonly string[]): boolean {\n return !block.files || block.files.some(pattern => targetFiles.some(file => matchesPattern(file, pattern)));\n}\n\n/**\n * Folds config blocks into one, like `mergeAll`, but skips every block whose `files` matches none of\n * `targetFiles`, so a block an upstream preset scopes to other file types cannot leak into the result.\n * @example\n * mergeAllFor(['file.ts'], [\n * { files: ['**\\/*.ts'], rules: { 'dot-notation': 'off' } },\n * { files: ['**\\/*.js'], rules: { 'no-var': 'off' } },\n * ]); // { files: ['**\\/*.ts'], rules: { 'dot-notation': 'off' } }\n */\nexport function mergeAllFor (targetFiles: readonly string[], ...configs: Linter.Config[][]) {\n return mergeAll(configs.flat().filter(block => appliesTo(block, targetFiles)));\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('mergeAll', () => {\n test('flattens every config array into a single block', () => {\n const result = mergeAll(\n [{ rules: { 'no-console': 'error' } }],\n [{ rules: { 'no-debugger': 'warn' } }]\n );\n\n expect(result).toStrictEqual({\n rules: {\n 'no-console': 'error',\n 'no-debugger': 'warn',\n },\n });\n });\n\n test('later arrays override earlier ones on overlapping rules', () => {\n const result = mergeAll(\n [{ rules: { semi: 'off' } }],\n [{ rules: { semi: 'error' } }]\n );\n\n expect(result.rules).toStrictEqual({ semi: 'error' });\n });\n\n test('later entries within one array override earlier entries', () => {\n const result = mergeAll([\n { rules: { semi: 'off' } },\n { rules: { semi: 'error' } },\n ]);\n\n expect(result.rules).toStrictEqual({ semi: 'error' });\n });\n\n test('does not mutate the caller-supplied config blocks', () => {\n const first: Linter.Config = { rules: { semi: 'off' } };\n const second: Linter.Config = { rules: { semi: 'error' } };\n\n mergeAll([first], [second]);\n\n expect(first.rules).toStrictEqual({ semi: 'off' });\n expect(second.rules).toStrictEqual({ semi: 'error' });\n });\n\n test('returns an empty config when given no blocks', () => {\n expect(mergeAll([])).toStrictEqual({});\n });\n });\n\n describe('mergeAllFor', () => {\n const javascriptOnly: Linter.Config = { files: ['**/*.js', '**/*.mjs'], rules: { 'no-var': 'off' } };\n const typescriptOnly: Linter.Config = { files: ['**/*.ts'], rules: { semi: 'off' } };\n const unscoped: Linter.Config = { rules: { 'no-console': 'error' } };\n\n test('keeps unscoped blocks and blocks whose files match a target', () => {\n const result = mergeAllFor(['file.ts'], [unscoped, javascriptOnly, typescriptOnly]);\n\n expect(result.rules).toStrictEqual({ 'no-console': 'error', semi: 'off' });\n });\n\n test('skips a block scoped only to other file types', () => {\n const result = mergeAllFor(['file.ts'], [javascriptOnly]);\n\n expect(result).toStrictEqual({});\n });\n\n test('keeps a block when any target matches', () => {\n const result = mergeAllFor(['file.vue', 'file.js'], [javascriptOnly, typescriptOnly]);\n\n expect(result.rules).toStrictEqual({ 'no-var': 'off' });\n });\n\n test('treats a nested pattern array as every part having to match', () => {\n const nested: Linter.Config = { files: [['**/*.ts', 'src/**']], rules: { semi: 'error' } };\n\n expect(mergeAllFor(['src/file.ts'], [nested]).rules).toStrictEqual({ semi: 'error' });\n expect(mergeAllFor(['file.ts'], [nested])).toStrictEqual({});\n });\n\n test('merges matching blocks across arrays in order', () => {\n const result = mergeAllFor(\n ['file.ts'],\n [{ rules: { semi: 'off' } }],\n [{ files: ['**/*.ts'], rules: { semi: 'error' } }]\n );\n\n expect(result.rules).toStrictEqual({ semi: 'error' });\n });\n });\n}\n"],"mappings":";;;AAIA,SAAgB,SAAU,GAAG,SAA0B;CACnD,OAAO,QAAQ,KAAI,CAAE,CAAC,QAAQ,KAAK,UAAU,MAAM,KAAK,KAAK,GAAG,CAAA,CAAmB;AACvF;AAEA,SAAS,eAAgB,UAAkB,SAA0B;CACjE,OAAO,MAAM,QAAQ,OAAO,IACtB,QAAQ,OAAM,SAAQ,YAAY,UAAU,IAAI,CAAC,IACjD,YAAY,UAAU,OAAO;AACvC;AAEA,SAAS,UAAW,OAAsB,aAA8B;CACpE,OAAO,CAAC,MAAM,SAAS,MAAM,MAAM,MAAK,YAAW,YAAY,MAAK,SAAQ,eAAe,MAAM,OAAO,CAAC,CAAC;AAC9G;;;;;;;;;;AAWA,SAAgB,YAAa,aAAgC,GAAG,SAA0B;CACtF,OAAO,SAAS,QAAQ,KAAI,CAAE,CAAC,QAAO,UAAS,UAAU,OAAO,WAAW,CAAC,CAAC;AACjF"}
|
package/dist/{removePluginsFromConfigs-D0oSUj2C.cjs → removePluginsFromConfigs-Cz6Uo9G0.cjs}
RENAMED
|
@@ -18,6 +18,8 @@ var typescript_default = { rules: {
|
|
|
18
18
|
"@typescript-eslint/space-before-blocks": "off",
|
|
19
19
|
"@typescript-eslint/object-curly-spacing": "off",
|
|
20
20
|
"no-redeclare": "off",
|
|
21
|
+
"dot-notation": "off",
|
|
22
|
+
"prefer-destructuring": "off",
|
|
21
23
|
"@typescript-eslint/func-call-spacing": "off",
|
|
22
24
|
"@typescript-eslint/no-shadow": "error",
|
|
23
25
|
"@typescript-eslint/no-unused-vars": ["error"],
|
|
@@ -40,7 +42,10 @@ var typescript_default = { rules: {
|
|
|
40
42
|
match: false
|
|
41
43
|
}
|
|
42
44
|
}],
|
|
43
|
-
"@typescript-eslint/await-thenable": "off"
|
|
45
|
+
"@typescript-eslint/await-thenable": "off",
|
|
46
|
+
"@typescript-eslint/no-unsafe-enum-assignment": "off",
|
|
47
|
+
"@typescript-eslint/return-await": ["warn", "in-try-catch"],
|
|
48
|
+
"@typescript-eslint/no-unnecessary-template-expression": "warn"
|
|
44
49
|
} };
|
|
45
50
|
//#endregion
|
|
46
51
|
//#region src/utils/removePluginsFromConfigs.ts
|
|
@@ -64,4 +69,4 @@ Object.defineProperty(exports, "typescript_default", {
|
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
|
|
67
|
-
//# sourceMappingURL=removePluginsFromConfigs-
|
|
72
|
+
//# sourceMappingURL=removePluginsFromConfigs-Cz6Uo9G0.cjs.map
|
package/dist/{removePluginsFromConfigs-D0oSUj2C.cjs.map → removePluginsFromConfigs-Cz6Uo9G0.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removePluginsFromConfigs-
|
|
1
|
+
{"version":3,"file":"removePluginsFromConfigs-Cz6Uo9G0.cjs","names":[],"sources":["../src/rules/typescript.ts","../src/utils/removePluginsFromConfigs.ts"],"sourcesContent":["import type { Linter } from 'eslint';\n\nconst overriddenRules: Linter.RulesRecord = {\n indent: 'off',\n 'no-undef': 'off',\n 'no-shadow': 'off',\n '@typescript-eslint/comma-dangle': 'off',\n 'no-extra-parens': 'off',\n '@typescript-eslint/no-extra-parens': 'off',\n '@typescript-eslint/space-before-function-paren': 'off',\n 'no-unused-vars': 'off',\n 'no-useless-constructor': 'off',\n '@typescript-eslint/indent': 'off',\n semi: 'off',\n '@typescript-eslint/semi': 'off',\n 'react/jsx-filename-extension': 'off',\n 'no-use-before-define': 'off',\n '@typescript-eslint/lines-between-class-members': 'off',\n '@typescript-eslint/comma-spacing': 'off',\n '@typescript-eslint/space-before-blocks': 'off',\n '@typescript-eslint/object-curly-spacing': 'off',\n 'no-redeclare': 'off',\n 'dot-notation': 'off',\n 'prefer-destructuring': 'off',\n // https://eslint.style/rules/ts/function-call-spacing\n '@typescript-eslint/func-call-spacing': 'off',\n};\n\nexport default {\n rules: {\n ...overriddenRules,\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/no-unused-vars': ['error'],\n '@typescript-eslint/no-useless-constructor': ['error'],\n '@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],\n '@typescript-eslint/no-misused-promises': ['error', {\n checksVoidReturn: { arguments: false },\n }],\n '@typescript-eslint/no-use-before-define': ['error'],\n '@typescript-eslint/consistent-type-imports': ['error', {\n fixStyle: 'inline-type-imports',\n disallowTypeAnnotations: false,\n }],\n '@typescript-eslint/naming-convention': ['error', {\n selector: ['typeLike'],\n format: ['PascalCase'],\n custom: {\n regex: '^((I|T|E|G|C)[A-Z][a-z]|[A-Z]{1,2}$)',\n match: false,\n },\n }],\n '@typescript-eslint/await-thenable': 'off',\n '@typescript-eslint/no-unsafe-enum-assignment': 'off',\n '@typescript-eslint/return-await': ['warn', 'in-try-catch'],\n '@typescript-eslint/no-unnecessary-template-expression': 'warn',\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport function removePluginsFromConfigs (configs: Linter.Config[]): Linter.Config[] {\n return configs.map(config => {\n // oxlint-disable-next-line @typescript-eslint/no-unused-vars\n const { plugins, ...rest } = config;\n\n return rest;\n });\n}\n"],"mappings":"AA4BA,IAAA,qBAAe,EACX,OAAO;CA1BP,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,mCAAmC;CACnC,mBAAmB;CACnB,sCAAsC;CACtC,kDAAkD;CAClD,kBAAkB;CAClB,0BAA0B;CAC1B,6BAA6B;CAC7B,MAAM;CACN,2BAA2B;CAC3B,gCAAgC;CAChC,wBAAwB;CACxB,kDAAkD;CAClD,oCAAoC;CACpC,0CAA0C;CAC1C,2CAA2C;CAC3C,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB;CAExB,wCAAwC;CAMpC,gCAAgC;CAChC,qCAAqC,CAAC,OAAO;CAC7C,6CAA6C,CAAC,OAAO;CACrD,iCAAiC,CAAC,SAAS;EAAE,SAAS;EAAS,UAAU;CAAO,CAAE;CAClF,0CAA0C,CAAC,SAAS,EAChD,kBAAkB,EAAE,WAAW,MAAK,EACvC,CAAA;CACD,2CAA2C,CAAC,OAAO;CACnD,8CAA8C,CAAC,SAAS;EACpD,UAAU;EACV,yBAAyB;CAC5B,CAAA;CACD,wCAAwC,CAAC,SAAS;EAC9C,UAAU,CAAC,UAAU;EACrB,QAAQ,CAAC,YAAY;EACrB,QAAQ;GACJ,OAAO;GACP,OAAO;EACV;CACJ,CAAA;CACD,qCAAqC;CACrC,gDAAgD;CAChD,mCAAmC,CAAC,QAAQ,cAAc;CAC1D,yDAAyD;AAC5D,EACa;;;ACtDlB,SAAgB,yBAA0B,SAAwB;CAC9D,OAAO,QAAQ,KAAI,WAAS;EAExB,MAAM,EAAE,SAAS,GAAG,SAAS;EAE7B,OAAO;CACX,CAAC;AACL"}
|
|
@@ -18,6 +18,8 @@ var typescript_default = { rules: {
|
|
|
18
18
|
"@typescript-eslint/space-before-blocks": "off",
|
|
19
19
|
"@typescript-eslint/object-curly-spacing": "off",
|
|
20
20
|
"no-redeclare": "off",
|
|
21
|
+
"dot-notation": "off",
|
|
22
|
+
"prefer-destructuring": "off",
|
|
21
23
|
"@typescript-eslint/func-call-spacing": "off",
|
|
22
24
|
"@typescript-eslint/no-shadow": "error",
|
|
23
25
|
"@typescript-eslint/no-unused-vars": ["error"],
|
|
@@ -40,7 +42,10 @@ var typescript_default = { rules: {
|
|
|
40
42
|
match: false
|
|
41
43
|
}
|
|
42
44
|
}],
|
|
43
|
-
"@typescript-eslint/await-thenable": "off"
|
|
45
|
+
"@typescript-eslint/await-thenable": "off",
|
|
46
|
+
"@typescript-eslint/no-unsafe-enum-assignment": "off",
|
|
47
|
+
"@typescript-eslint/return-await": ["warn", "in-try-catch"],
|
|
48
|
+
"@typescript-eslint/no-unnecessary-template-expression": "warn"
|
|
44
49
|
} };
|
|
45
50
|
//#endregion
|
|
46
51
|
//#region src/utils/removePluginsFromConfigs.ts
|
|
@@ -53,4 +58,4 @@ function removePluginsFromConfigs(configs) {
|
|
|
53
58
|
//#endregion
|
|
54
59
|
export { typescript_default as n, removePluginsFromConfigs as t };
|
|
55
60
|
|
|
56
|
-
//# sourceMappingURL=removePluginsFromConfigs-
|
|
61
|
+
//# sourceMappingURL=removePluginsFromConfigs-Di0LcQV7.js.map
|
package/dist/{removePluginsFromConfigs-DzqX2Ju2.js.map → removePluginsFromConfigs-Di0LcQV7.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removePluginsFromConfigs-
|
|
1
|
+
{"version":3,"file":"removePluginsFromConfigs-Di0LcQV7.js","names":[],"sources":["../src/rules/typescript.ts","../src/utils/removePluginsFromConfigs.ts"],"sourcesContent":["import type { Linter } from 'eslint';\n\nconst overriddenRules: Linter.RulesRecord = {\n indent: 'off',\n 'no-undef': 'off',\n 'no-shadow': 'off',\n '@typescript-eslint/comma-dangle': 'off',\n 'no-extra-parens': 'off',\n '@typescript-eslint/no-extra-parens': 'off',\n '@typescript-eslint/space-before-function-paren': 'off',\n 'no-unused-vars': 'off',\n 'no-useless-constructor': 'off',\n '@typescript-eslint/indent': 'off',\n semi: 'off',\n '@typescript-eslint/semi': 'off',\n 'react/jsx-filename-extension': 'off',\n 'no-use-before-define': 'off',\n '@typescript-eslint/lines-between-class-members': 'off',\n '@typescript-eslint/comma-spacing': 'off',\n '@typescript-eslint/space-before-blocks': 'off',\n '@typescript-eslint/object-curly-spacing': 'off',\n 'no-redeclare': 'off',\n 'dot-notation': 'off',\n 'prefer-destructuring': 'off',\n // https://eslint.style/rules/ts/function-call-spacing\n '@typescript-eslint/func-call-spacing': 'off',\n};\n\nexport default {\n rules: {\n ...overriddenRules,\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/no-unused-vars': ['error'],\n '@typescript-eslint/no-useless-constructor': ['error'],\n '@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],\n '@typescript-eslint/no-misused-promises': ['error', {\n checksVoidReturn: { arguments: false },\n }],\n '@typescript-eslint/no-use-before-define': ['error'],\n '@typescript-eslint/consistent-type-imports': ['error', {\n fixStyle: 'inline-type-imports',\n disallowTypeAnnotations: false,\n }],\n '@typescript-eslint/naming-convention': ['error', {\n selector: ['typeLike'],\n format: ['PascalCase'],\n custom: {\n regex: '^((I|T|E|G|C)[A-Z][a-z]|[A-Z]{1,2}$)',\n match: false,\n },\n }],\n '@typescript-eslint/await-thenable': 'off',\n '@typescript-eslint/no-unsafe-enum-assignment': 'off',\n '@typescript-eslint/return-await': ['warn', 'in-try-catch'],\n '@typescript-eslint/no-unnecessary-template-expression': 'warn',\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport function removePluginsFromConfigs (configs: Linter.Config[]): Linter.Config[] {\n return configs.map(config => {\n // oxlint-disable-next-line @typescript-eslint/no-unused-vars\n const { plugins, ...rest } = config;\n\n return rest;\n });\n}\n"],"mappings":"AA4BA,IAAA,qBAAe,EACX,OAAO;CA1BP,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,mCAAmC;CACnC,mBAAmB;CACnB,sCAAsC;CACtC,kDAAkD;CAClD,kBAAkB;CAClB,0BAA0B;CAC1B,6BAA6B;CAC7B,MAAM;CACN,2BAA2B;CAC3B,gCAAgC;CAChC,wBAAwB;CACxB,kDAAkD;CAClD,oCAAoC;CACpC,0CAA0C;CAC1C,2CAA2C;CAC3C,gBAAgB;CAChB,gBAAgB;CAChB,wBAAwB;CAExB,wCAAwC;CAMpC,gCAAgC;CAChC,qCAAqC,CAAC,OAAO;CAC7C,6CAA6C,CAAC,OAAO;CACrD,iCAAiC,CAAC,SAAS;EAAE,SAAS;EAAS,UAAU;CAAO,CAAE;CAClF,0CAA0C,CAAC,SAAS,EAChD,kBAAkB,EAAE,WAAW,MAAK,EACvC,CAAA;CACD,2CAA2C,CAAC,OAAO;CACnD,8CAA8C,CAAC,SAAS;EACpD,UAAU;EACV,yBAAyB;CAC5B,CAAA;CACD,wCAAwC,CAAC,SAAS;EAC9C,UAAU,CAAC,UAAU;EACrB,QAAQ,CAAC,YAAY;EACrB,QAAQ;GACJ,OAAO;GACP,OAAO;EACV;CACJ,CAAA;CACD,qCAAqC;CACrC,gDAAgD;CAChD,mCAAmC,CAAC,QAAQ,cAAc;CAC1D,yDAAyD;AAC5D,EACa;;;ACtDlB,SAAgB,yBAA0B,SAAwB;CAC9D,OAAO,QAAQ,KAAI,WAAS;EAExB,MAAM,EAAE,SAAS,GAAG,SAAS;EAE7B,OAAO;CACX,CAAC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removedOptions-BYMW8w__.cjs","names":[],"sources":["../src/builders/oxlintOwnership.ts","../src/utils/removedOptions.ts"],"sourcesContent":["import type { Linter } from 'eslint';\nimport oxlintPlugin from 'eslint-plugin-oxlint';\nimport * as rulesByCategory from 'eslint-plugin-oxlint/rules-by-category';\nimport * as rulesByScope from 'eslint-plugin-oxlint/rules-by-scope';\n\nconst ESLINT_IMPORT_PREFIX = 'import-x/';\nconst OXLINT_IMPORT_PREFIX = 'import/';\nconst ESLINT_TYPESCRIPT_PREFIX = '@typescript-eslint/';\nconst OXLINT_TYPESCRIPT_PREFIX = 'typescript/';\n\nexport const VUE_LIKE_GLOBS: readonly string[] = ['**/*.vue', '**/*.svelte', '**/*.astro'];\n\nexport const OXLINT_CATEGORIES: readonly string[] = [\n 'correctness',\n 'suspicious',\n 'pedantic',\n 'perf',\n 'style',\n 'restriction',\n 'nursery',\n];\n\n// oxlint has no equivalent of flat-config `settings`, so any rule whose ESLint behavior is driven\n// by a settings key stays on the ESLint side. `jsdoc/check-tag-names` reads\n// `settings.jsdoc.tagNamePreference`, which the TypeScript presets use to remap `@desc`/`@callback`\n// onto `@use`/`@watch`; oxlint rejects both of those tags outright.\nexport const SETTINGS_DEPENDENT_RULES: readonly string[] = ['jsdoc/check-tag-names'];\n\n// Rules both linters implement, but whose omitted options resolve to different defaults — a bare\n// `'error'` therefore means something stricter under oxlint. `no-inner-declarations` defaults\n// `blockScopedFunctions` to `'allow'` in ESLint 9 and to `'disallow'` in oxlint, so handing oxlint\n// the preset's `'error'` would reject every block-scoped function declaration ESLint accepts.\nexport const DEFAULT_DIVERGENT_RULES: readonly string[] = ['no-inner-declarations'];\n\n// `eslint-plugin-oxlint` re-enables these for SFC-like files because oxlint cannot parse their\n// templates. Kept as a floor under the value derived from the plugin at runtime so a shape change\n// upstream can never silently drop the exception.\nconst VUE_UNSAFE_FALLBACK: readonly string[] = [\n 'no-unused-vars',\n '@typescript-eslint/no-unused-vars',\n '@typescript-eslint/consistent-type-imports',\n 'react-hooks/rules-of-hooks',\n];\n\nconst eslintPrefixToOxlintPlugin: Readonly<Record<string, string>> = {\n 'import-x': 'import',\n import: 'import',\n '@typescript-eslint': 'typescript',\n n: 'node',\n '@next/next': 'nextjs',\n 'react-hooks': 'react',\n 'react-perf': 'react-perf',\n 'jsx-a11y': 'jsx-a11y',\n};\n\nfunction collectRuleNames (namespace: Record<string, unknown>): string[] {\n return Object.values(namespace).flatMap(value => {\n if (typeof value !== 'object' || value === null) {\n return [];\n }\n\n const entries = Object.entries(value as Record<string, unknown>);\n const isRuleRecord = entries.length > 0 && entries.every(([, severity]) => severity === 'off');\n\n return isRuleRecord ? entries.map(([rule]) => rule) : [];\n });\n}\n\nfunction pickNamespace (\n namespace: Record<string, unknown>,\n matches: (key: string) => boolean\n): Record<string, unknown> {\n return Object.fromEntries(Object.entries(namespace).filter(([key]) => matches(key)));\n}\n\nconst categoryNamespace = rulesByCategory as Record<string, unknown>;\nconst scopeNamespace = rulesByScope as Record<string, unknown>;\nconst implementedRules = new Set(collectRuleNames(scopeNamespace));\n\n// Type-aware rules need `oxlint-tsgolint`, which this stage does not wire up, and nursery rules are\n// exempt from oxlint's semver guarantees. Both stay with ESLint.\nconst excludedRules = new Set([\n ...collectRuleNames(pickNamespace(categoryNamespace, key => key.endsWith('TypeAwareRules'))),\n ...collectRuleNames(pickNamespace(scopeNamespace, key => key.endsWith('TypeAwareRules'))),\n ...collectRuleNames(pickNamespace(categoryNamespace, key => key.startsWith('nursery'))),\n ...SETTINGS_DEPENDENT_RULES,\n ...DEFAULT_DIVERGENT_RULES,\n]);\n\n/**\n * The rules `eslint-plugin-oxlint` re-enables for `.vue`/`.svelte`/`.astro`, read from the plugin's\n * own `flat/all` split so the list tracks upstream instead of being hand-maintained.\n * @example\n * readVueUnsafeRules().includes('@typescript-eslint/no-unused-vars'); // true\n */\nexport function readVueUnsafeRules (): string[] {\n const [, exceptions] = oxlintPlugin.configs['flat/all'];\n const derived = exceptions?.rules ? Object.keys(exceptions.rules) : [];\n\n return [...new Set([...derived, ...VUE_UNSAFE_FALLBACK])];\n}\n\nconst vueUnsafeRules = new Set(readVueUnsafeRules());\n\nfunction normalizeToOxlintNamespace (eslintRuleName: string): string {\n return eslintRuleName.startsWith(ESLINT_IMPORT_PREFIX)\n ? `${OXLINT_IMPORT_PREFIX}${eslintRuleName.slice(ESLINT_IMPORT_PREFIX.length)}`\n : eslintRuleName;\n}\n\n/**\n * Whether oxlint owns this ESLint rule in the current split — implemented natively, not type-aware,\n * not nursery, and not driven by a flat-config `settings` key oxlint cannot read.\n * @example\n * isOxlintOwned('import-x/no-duplicates'); // true — oxlint implements it as `import/no-duplicates`\n * isOxlintOwned('sonarjs/no-identical-functions'); // false\n */\nexport function isOxlintOwned (eslintRuleName: string): boolean {\n const normalized = normalizeToOxlintNamespace(eslintRuleName);\n\n return implementedRules.has(normalized) && !excludedRules.has(normalized);\n}\n\n/**\n * Whether ESLint must keep running this rule on SFC-like files because oxlint cannot parse their\n * templates. Callers must exclude `**\\/*.vue`, `**\\/*.svelte` and `**\\/*.astro` from its suppression.\n * @example\n * isVueUnsafeRule('@typescript-eslint/no-unused-vars'); // true\n */\nexport function isVueUnsafeRule (eslintRuleName: string): boolean {\n return vueUnsafeRules.has(normalizeToOxlintNamespace(eslintRuleName));\n}\n\n/**\n * Translates an ESLint rule name into the name oxlint accepts in its config.\n * @example\n * toOxlintRuleName('no-var'); // 'eslint/no-var'\n * toOxlintRuleName('import-x/first'); // 'import/first'\n * toOxlintRuleName('@typescript-eslint/array-type'); // 'typescript/array-type'\n */\nexport function toOxlintRuleName (eslintRuleName: string): string {\n if (!eslintRuleName.includes('/')) {\n return `eslint/${eslintRuleName}`;\n }\n\n if (eslintRuleName.startsWith(ESLINT_TYPESCRIPT_PREFIX)) {\n return `${OXLINT_TYPESCRIPT_PREFIX}${eslintRuleName.slice(ESLINT_TYPESCRIPT_PREFIX.length)}`;\n }\n\n return normalizeToOxlintNamespace(eslintRuleName);\n}\n\n/**\n * The oxlint plugin id that must appear in the config's `plugins` array for a rule to be loaded.\n * @example\n * toOxlintPluginName('import-x/first'); // 'import'\n * toOxlintPluginName('no-var'); // 'eslint'\n */\nexport function toOxlintPluginName (eslintRuleName: string): string {\n if (!eslintRuleName.includes('/')) {\n return 'eslint';\n }\n\n const prefix = eslintRuleName.slice(0, eslintRuleName.lastIndexOf('/'));\n\n return eslintPrefixToOxlintPlugin[prefix] ?? prefix;\n}\n\nexport function isRuleDisabled (entry: Linter.RuleEntry | undefined): boolean {\n if (entry === undefined) {\n return true;\n }\n\n const [severity] = Array.isArray(entry) ? entry : [entry];\n\n return severity === 'off' || severity === 0;\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('isOxlintOwned', () => {\n test('claims a natively implemented core rule', () => {\n expect(isOxlintOwned('no-var')).toBe(true);\n });\n\n test('claims an import-x rule through the import-x → import alias', () => {\n expect(isOxlintOwned('import-x/no-duplicates')).toBe(true);\n });\n\n test('leaves type-aware typescript rules with ESLint', () => {\n expect(isOxlintOwned('@typescript-eslint/no-floating-promises')).toBe(false);\n });\n\n test('leaves rules oxlint does not implement with ESLint', () => {\n expect(isOxlintOwned('sonarjs/no-identical-functions')).toBe(false);\n expect(isOxlintOwned('@stylistic/indent')).toBe(false);\n expect(isOxlintOwned('@cspell/spellchecker')).toBe(false);\n });\n\n test('leaves settings-dependent rules with ESLint', () => {\n expect(isOxlintOwned('jsdoc/check-tag-names')).toBe(false);\n });\n\n test('leaves rules whose omitted options resolve to different defaults with ESLint', () => {\n expect(DEFAULT_DIVERGENT_RULES.every(rule => !isOxlintOwned(rule))).toBe(true);\n expect(isOxlintOwned('no-inner-declarations')).toBe(false);\n });\n\n const nurseryRules = collectRuleNames(pickNamespace(categoryNamespace, key => key.startsWith('nursery')));\n\n test('reads a non-empty nursery namespace, so the exclusion below is not vacuous', () => {\n expect(nurseryRules.length).toBeGreaterThan(0);\n });\n\n test('leaves every nursery rule with ESLint, since nursery is exempt from oxlint semver', () => {\n expect(nurseryRules.filter(rule => isOxlintOwned(rule))).toStrictEqual([]);\n });\n });\n\n describe('isVueUnsafeRule', () => {\n test.each([...VUE_UNSAFE_FALLBACK])('keeps %s with ESLint inside single-file components', ruleName => {\n expect(isVueUnsafeRule(ruleName)).toBe(true);\n });\n\n test.each([\n 'no-var',\n 'no-console',\n 'sonarjs/no-identical-functions',\n ])('lets oxlint keep %s inside single-file components', ruleName => {\n expect(isVueUnsafeRule(ruleName)).toBe(false);\n });\n\n test('does not read an import-x rule as the bare ESLint rule of the same suffix', () => {\n expect(isVueUnsafeRule('import-x/no-unused-vars')).toBe(false);\n });\n });\n\n describe('toOxlintRuleName', () => {\n test.each([\n ['no-var', 'eslint/no-var'],\n ['import-x/first', 'import/first'],\n ['@typescript-eslint/array-type', 'typescript/array-type'],\n ['jsdoc/empty-tags', 'jsdoc/empty-tags'],\n ['vue/no-dupe-keys', 'vue/no-dupe-keys'],\n ])('%s → %s', (eslintName, expected) => {\n expect(toOxlintRuleName(eslintName)).toBe(expected);\n });\n });\n\n describe('toOxlintPluginName', () => {\n const expectedPluginByPrefix: Readonly<Record<string, string>> = {\n 'import-x': 'import',\n import: 'import',\n '@typescript-eslint': 'typescript',\n n: 'node',\n '@next/next': 'nextjs',\n 'react-hooks': 'react',\n 'react-perf': 'react-perf',\n 'jsx-a11y': 'jsx-a11y',\n };\n\n const byName = (left: string, right: string): number => left.localeCompare(right);\n\n test('names every prefix the remap table carries, so no entry goes unexercised', () => {\n expect(Object.keys(expectedPluginByPrefix).sort(byName))\n .toStrictEqual(Object.keys(eslintPrefixToOxlintPlugin).sort(byName));\n });\n\n test.each(Object.entries(expectedPluginByPrefix))(\n 'a %s rule loads the %s plugin',\n (prefix, plugin) => {\n expect(toOxlintPluginName(`${prefix}/some-rule`)).toBe(plugin);\n }\n );\n\n test.each([\n ['no-var', 'eslint'],\n ['jsdoc/empty-tags', 'jsdoc'],\n ['vitest/no-focused-tests', 'vitest'],\n ['vue/no-dupe-keys', 'vue'],\n ])('%s → %s', (eslintName, expected) => {\n expect(toOxlintPluginName(eslintName)).toBe(expected);\n });\n });\n\n describe('readVueUnsafeRules', () => {\n test('derives the upstream exception list rather than only the pinned fallback', () => {\n const [, exceptions] = oxlintPlugin.configs['flat/all'];\n\n expect(exceptions?.rules).toBeDefined();\n expect(Object.keys(exceptions?.rules ?? {}).length).toBeGreaterThan(0);\n });\n\n test('covers every rule oxlint cannot check inside an SFC', () => {\n expect(readVueUnsafeRules()).toEqual(expect.arrayContaining([...VUE_UNSAFE_FALLBACK]));\n });\n });\n\n describe('isRuleDisabled', () => {\n test.each([\n [undefined, true],\n ['off' as Linter.RuleEntry, true],\n [0 as Linter.RuleEntry, true],\n [['off'] as Linter.RuleEntry, true],\n ['error' as Linter.RuleEntry, false],\n [['error', { allow: [] }] as Linter.RuleEntry, false],\n [2 as Linter.RuleEntry, false],\n ])('%s → %s', (entry, expected) => {\n expect(isRuleDisabled(entry)).toBe(expected);\n });\n });\n}\n","export const removedOptions: ReadonlyMap<string, string> = new Map([\n [\n 'config',\n 'use `configFiles: string[]` instead. Its block is emitted after every scope block, so'\n + ' the overrides actually win; the `config` scope was emitted before them and was silently'\n + ' overridden for any file a language scope also matched.',\n ],\n]);\n\n/**\n * Renders the bullet list naming every removed option among `keys`, or `null` when none of them was\n * removed. Both the runtime rejection and the migration's refusal read this registry, so a consumer\n * who hits one after the other is given the same replacement rather than two wordings of it.\n * @example\n * describeRemovedOptions(['config']); // ' - `config`: use `configFiles: string[]` instead. …'\n * describeRemovedOptions(['strict']); // null\n */\nexport function describeRemovedOptions (keys: readonly string[]): string | null {\n const used = keys.filter(key => removedOptions.has(key));\n\n if (used.length === 0) {\n return null;\n }\n\n return used.map(key => ` - \\`${key}\\`: ${removedOptions.get(key)}`).join('\\n');\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('describeRemovedOptions', () => {\n test('returns null when no key was removed', () => {\n expect(describeRemovedOptions(['ignores', 'strict', 'typescriptNode'])).toBeNull();\n });\n\n test('names the replacement for every registered removal', () => {\n [...removedOptions.keys()].forEach(key => {\n const described = describeRemovedOptions([key]);\n\n expect(described).toContain(`\\`${key}\\``);\n expect(described).toBe(` - \\`${key}\\`: ${removedOptions.get(key)}`);\n });\n });\n\n test('points `config` at configFiles', () => {\n expect(describeRemovedOptions(['config'])).toContain('`configFiles: string[]`');\n });\n\n test('lists one bullet per line, in the order the keys were given', () => {\n const described = describeRemovedOptions(['strict', ...removedOptions.keys()]);\n\n expect(described?.split('\\n')).toHaveLength(removedOptions.size);\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AACjC,IAAM,2BAA2B;AAEjC,IAAa,iBAAoC;CAAC;CAAY;CAAe;AAAY;AAEzF,IAAa,oBAAuC;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;AACH;AAMD,IAAa,2BAA8C,CAAC,uBAAuB;AAMnF,IAAa,0BAA6C,CAAC,uBAAuB;AAKlF,IAAM,sBAAyC;CAC3C;CACA;CACA;CACA;AACH;AAED,IAAM,6BAA+D;CACjE,YAAY;CACZ,QAAQ;CACR,sBAAsB;CACtB,GAAG;CACH,cAAc;CACd,eAAe;CACf,cAAc;CACd,YAAY;AACf;AAED,SAAS,iBAAkB,WAAkC;CACzD,OAAO,OAAO,OAAO,SAAS,CAAC,CAAC,SAAQ,UAAQ;EAC5C,I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I,UAAU,KAAK,CAAC,cAAc,IAAI,UAAU;AAC5E;;;;;;;AAQA,SAAgB,gBAAiB,gBAAsB;CACnD,OAAO,eAAe,IAAI,2BAA2B,cAAc,CAAC;AACxE;;;;;;;;AASA,SAAgB,iBAAkB,gBAAsB;CACpD,IAAI,CAAC,eAAe,SAAS,GAAG,GAC5B,OAAO,UAAU;CAGrB,IAAI,eAAe,WAAW,wBAAwB,GAClD,OAAO,GAAG,2BAA2B,eAAe,MAAM,EAA+B;CAG7F,OAAO,2BAA2B,cAAc;AACpD;;;;;;;AAQA,SAAgB,mBAAoB,gBAAsB;CACtD,IAAI,CAAC,eAAe,SAAS,GAAG,GAC5B,OAAO;CAGX,MAAM,SAAS,eAAe,MAAM,GAAG,eAAe,YAAY,GAAG,CAAC;CAEtE,OAAO,2BAA2B,WAAW;AACjD;AAEA,SAAgB,eAAgB,OAAmC;CAC/D,IAAI,UAAU,KAAA,GACV,OAAO;CAGX,MAAM,CAAC,YAAY,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;CAExD,OAAO,aAAa,SAAS,aAAa;AAC9C;;;AChLA,IAAa,iCAA8C,IAAI,IAAI,CAC/D,CACI,UACA,sOAGH,CACJ,CAAA;;;;;;;;;AAUD,SAAgB,uBAAwB,MAAuB;CAC3D,MAAM,OAAO,KAAK,QAAO,QAAO,eAAe,IAAI,GAAG,CAAC;CAEvD,IAAI,KAAK,WAAW,GAChB,OAAO;CAGX,OAAO,KAAK,KAAI,QAAO,SAAS,IAAG,MAAO,eAAe,IAAI,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;AAClF"}
|
|
1
|
+
{"version":3,"file":"removedOptions-BYMW8w__.cjs","names":["rulesByCategory","rulesByScope","oxlintPlugin"],"sources":["../src/builders/oxlintOwnership.ts","../src/utils/removedOptions.ts"],"sourcesContent":["import type { Linter } from 'eslint';\nimport oxlintPlugin from 'eslint-plugin-oxlint';\nimport * as rulesByCategory from 'eslint-plugin-oxlint/rules-by-category';\nimport * as rulesByScope from 'eslint-plugin-oxlint/rules-by-scope';\n\nconst ESLINT_IMPORT_PREFIX = 'import-x/';\nconst OXLINT_IMPORT_PREFIX = 'import/';\nconst ESLINT_TYPESCRIPT_PREFIX = '@typescript-eslint/';\nconst OXLINT_TYPESCRIPT_PREFIX = 'typescript/';\n\nexport const VUE_LIKE_GLOBS: readonly string[] = ['**/*.vue', '**/*.svelte', '**/*.astro'];\n\nexport const OXLINT_CATEGORIES: readonly string[] = [\n 'correctness',\n 'suspicious',\n 'pedantic',\n 'perf',\n 'style',\n 'restriction',\n 'nursery',\n];\n\n// oxlint has no equivalent of flat-config `settings`, so any rule whose ESLint behavior is driven\n// by a settings key stays on the ESLint side. `jsdoc/check-tag-names` reads\n// `settings.jsdoc.tagNamePreference`, which the TypeScript presets use to remap `@desc`/`@callback`\n// onto `@use`/`@watch`; oxlint rejects both of those tags outright.\nexport const SETTINGS_DEPENDENT_RULES: readonly string[] = ['jsdoc/check-tag-names'];\n\n// Rules both linters implement, but whose omitted options resolve to different defaults — a bare\n// `'error'` therefore means something stricter under oxlint. `no-inner-declarations` defaults\n// `blockScopedFunctions` to `'allow'` in ESLint 9 and to `'disallow'` in oxlint, so handing oxlint\n// the preset's `'error'` would reject every block-scoped function declaration ESLint accepts.\nexport const DEFAULT_DIVERGENT_RULES: readonly string[] = ['no-inner-declarations'];\n\n// `eslint-plugin-oxlint` re-enables these for SFC-like files because oxlint cannot parse their\n// templates. Kept as a floor under the value derived from the plugin at runtime so a shape change\n// upstream can never silently drop the exception.\nconst VUE_UNSAFE_FALLBACK: readonly string[] = [\n 'no-unused-vars',\n '@typescript-eslint/no-unused-vars',\n '@typescript-eslint/consistent-type-imports',\n 'react-hooks/rules-of-hooks',\n];\n\nconst eslintPrefixToOxlintPlugin: Readonly<Record<string, string>> = {\n 'import-x': 'import',\n import: 'import',\n '@typescript-eslint': 'typescript',\n n: 'node',\n '@next/next': 'nextjs',\n 'react-hooks': 'react',\n 'react-perf': 'react-perf',\n 'jsx-a11y': 'jsx-a11y',\n};\n\nfunction collectRuleNames (namespace: Record<string, unknown>): string[] {\n return Object.values(namespace).flatMap(value => {\n if (typeof value !== 'object' || value === null) {\n return [];\n }\n\n const entries = Object.entries(value as Record<string, unknown>);\n const isRuleRecord = entries.length > 0 && entries.every(([, severity]) => severity === 'off');\n\n return isRuleRecord ? entries.map(([rule]) => rule) : [];\n });\n}\n\nfunction pickNamespace (\n namespace: Record<string, unknown>,\n matches: (key: string) => boolean\n): Record<string, unknown> {\n return Object.fromEntries(Object.entries(namespace).filter(([key]) => matches(key)));\n}\n\nconst categoryNamespace = rulesByCategory as Record<string, unknown>;\nconst scopeNamespace = rulesByScope as Record<string, unknown>;\nconst implementedRules = new Set(collectRuleNames(scopeNamespace));\n\n// Type-aware rules need `oxlint-tsgolint`, which this stage does not wire up, and nursery rules are\n// exempt from oxlint's semver guarantees. Both stay with ESLint.\nconst excludedRules = new Set([\n ...collectRuleNames(pickNamespace(categoryNamespace, key => key.endsWith('TypeAwareRules'))),\n ...collectRuleNames(pickNamespace(scopeNamespace, key => key.endsWith('TypeAwareRules'))),\n ...collectRuleNames(pickNamespace(categoryNamespace, key => key.startsWith('nursery'))),\n ...SETTINGS_DEPENDENT_RULES,\n ...DEFAULT_DIVERGENT_RULES,\n]);\n\n/**\n * The rules `eslint-plugin-oxlint` re-enables for `.vue`/`.svelte`/`.astro`, read from the plugin's\n * own `flat/all` split so the list tracks upstream instead of being hand-maintained.\n * @example\n * readVueUnsafeRules().includes('@typescript-eslint/no-unused-vars'); // true\n */\nexport function readVueUnsafeRules (): string[] {\n const [, exceptions] = oxlintPlugin.configs['flat/all'];\n const derived = exceptions?.rules ? Object.keys(exceptions.rules) : [];\n\n return [...new Set([...derived, ...VUE_UNSAFE_FALLBACK])];\n}\n\nconst vueUnsafeRules = new Set(readVueUnsafeRules());\n\nfunction normalizeToOxlintNamespace (eslintRuleName: string): string {\n return eslintRuleName.startsWith(ESLINT_IMPORT_PREFIX)\n ? `${OXLINT_IMPORT_PREFIX}${eslintRuleName.slice(ESLINT_IMPORT_PREFIX.length)}`\n : eslintRuleName;\n}\n\n/**\n * Whether oxlint owns this ESLint rule in the current split — implemented natively, not type-aware,\n * not nursery, and not driven by a flat-config `settings` key oxlint cannot read.\n * @example\n * isOxlintOwned('import-x/no-duplicates'); // true — oxlint implements it as `import/no-duplicates`\n * isOxlintOwned('sonarjs/no-identical-functions'); // false\n */\nexport function isOxlintOwned (eslintRuleName: string): boolean {\n const normalized = normalizeToOxlintNamespace(eslintRuleName);\n\n return implementedRules.has(normalized) && !excludedRules.has(normalized);\n}\n\n/**\n * Whether ESLint must keep running this rule on SFC-like files because oxlint cannot parse their\n * templates. Callers must exclude `**\\/*.vue`, `**\\/*.svelte` and `**\\/*.astro` from its suppression.\n * @example\n * isVueUnsafeRule('@typescript-eslint/no-unused-vars'); // true\n */\nexport function isVueUnsafeRule (eslintRuleName: string): boolean {\n return vueUnsafeRules.has(normalizeToOxlintNamespace(eslintRuleName));\n}\n\n/**\n * Translates an ESLint rule name into the name oxlint accepts in its config.\n * @example\n * toOxlintRuleName('no-var'); // 'eslint/no-var'\n * toOxlintRuleName('import-x/first'); // 'import/first'\n * toOxlintRuleName('@typescript-eslint/array-type'); // 'typescript/array-type'\n */\nexport function toOxlintRuleName (eslintRuleName: string): string {\n if (!eslintRuleName.includes('/')) {\n return `eslint/${eslintRuleName}`;\n }\n\n if (eslintRuleName.startsWith(ESLINT_TYPESCRIPT_PREFIX)) {\n return `${OXLINT_TYPESCRIPT_PREFIX}${eslintRuleName.slice(ESLINT_TYPESCRIPT_PREFIX.length)}`;\n }\n\n return normalizeToOxlintNamespace(eslintRuleName);\n}\n\n/**\n * The oxlint plugin id that must appear in the config's `plugins` array for a rule to be loaded.\n * @example\n * toOxlintPluginName('import-x/first'); // 'import'\n * toOxlintPluginName('no-var'); // 'eslint'\n */\nexport function toOxlintPluginName (eslintRuleName: string): string {\n if (!eslintRuleName.includes('/')) {\n return 'eslint';\n }\n\n const prefix = eslintRuleName.slice(0, eslintRuleName.lastIndexOf('/'));\n\n return eslintPrefixToOxlintPlugin[prefix] ?? prefix;\n}\n\nexport function isRuleDisabled (entry: Linter.RuleEntry | undefined): boolean {\n if (entry === undefined) {\n return true;\n }\n\n const [severity] = Array.isArray(entry) ? entry : [entry];\n\n return severity === 'off' || severity === 0;\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('isOxlintOwned', () => {\n test('claims a natively implemented core rule', () => {\n expect(isOxlintOwned('no-var')).toBe(true);\n });\n\n test('claims an import-x rule through the import-x → import alias', () => {\n expect(isOxlintOwned('import-x/no-duplicates')).toBe(true);\n });\n\n test('leaves type-aware typescript rules with ESLint', () => {\n expect(isOxlintOwned('@typescript-eslint/no-floating-promises')).toBe(false);\n });\n\n test('leaves rules oxlint does not implement with ESLint', () => {\n expect(isOxlintOwned('sonarjs/no-identical-functions')).toBe(false);\n expect(isOxlintOwned('@stylistic/indent')).toBe(false);\n expect(isOxlintOwned('@cspell/spellchecker')).toBe(false);\n });\n\n test('leaves settings-dependent rules with ESLint', () => {\n expect(isOxlintOwned('jsdoc/check-tag-names')).toBe(false);\n });\n\n test('leaves rules whose omitted options resolve to different defaults with ESLint', () => {\n expect(DEFAULT_DIVERGENT_RULES.every(rule => !isOxlintOwned(rule))).toBe(true);\n expect(isOxlintOwned('no-inner-declarations')).toBe(false);\n });\n\n const nurseryRules = collectRuleNames(pickNamespace(categoryNamespace, key => key.startsWith('nursery')));\n\n test('reads a non-empty nursery namespace, so the exclusion below is not vacuous', () => {\n expect(nurseryRules.length).toBeGreaterThan(0);\n });\n\n test('leaves every nursery rule with ESLint, since nursery is exempt from oxlint semver', () => {\n expect(nurseryRules.filter(rule => isOxlintOwned(rule))).toStrictEqual([]);\n });\n });\n\n describe('isVueUnsafeRule', () => {\n test.each([...VUE_UNSAFE_FALLBACK])('keeps %s with ESLint inside single-file components', ruleName => {\n expect(isVueUnsafeRule(ruleName)).toBe(true);\n });\n\n test.each([\n 'no-var',\n 'no-console',\n 'sonarjs/no-identical-functions',\n ])('lets oxlint keep %s inside single-file components', ruleName => {\n expect(isVueUnsafeRule(ruleName)).toBe(false);\n });\n\n test('does not read an import-x rule as the bare ESLint rule of the same suffix', () => {\n expect(isVueUnsafeRule('import-x/no-unused-vars')).toBe(false);\n });\n });\n\n describe('toOxlintRuleName', () => {\n test.each([\n ['no-var', 'eslint/no-var'],\n ['import-x/first', 'import/first'],\n ['@typescript-eslint/array-type', 'typescript/array-type'],\n ['jsdoc/empty-tags', 'jsdoc/empty-tags'],\n ['vue/no-dupe-keys', 'vue/no-dupe-keys'],\n ])('%s → %s', (eslintName, expected) => {\n expect(toOxlintRuleName(eslintName)).toBe(expected);\n });\n });\n\n describe('toOxlintPluginName', () => {\n const expectedPluginByPrefix: Readonly<Record<string, string>> = {\n 'import-x': 'import',\n import: 'import',\n '@typescript-eslint': 'typescript',\n n: 'node',\n '@next/next': 'nextjs',\n 'react-hooks': 'react',\n 'react-perf': 'react-perf',\n 'jsx-a11y': 'jsx-a11y',\n };\n\n const byName = (left: string, right: string): number => left.localeCompare(right);\n\n test('names every prefix the remap table carries, so no entry goes unexercised', () => {\n expect(Object.keys(expectedPluginByPrefix).sort(byName))\n .toStrictEqual(Object.keys(eslintPrefixToOxlintPlugin).sort(byName));\n });\n\n test.each(Object.entries(expectedPluginByPrefix))(\n 'a %s rule loads the %s plugin',\n (prefix, plugin) => {\n expect(toOxlintPluginName(`${prefix}/some-rule`)).toBe(plugin);\n }\n );\n\n test.each([\n ['no-var', 'eslint'],\n ['jsdoc/empty-tags', 'jsdoc'],\n ['vitest/no-focused-tests', 'vitest'],\n ['vue/no-dupe-keys', 'vue'],\n ])('%s → %s', (eslintName, expected) => {\n expect(toOxlintPluginName(eslintName)).toBe(expected);\n });\n });\n\n describe('readVueUnsafeRules', () => {\n test('derives the upstream exception list rather than only the pinned fallback', () => {\n const [, exceptions] = oxlintPlugin.configs['flat/all'];\n\n expect(exceptions?.rules).toBeDefined();\n expect(Object.keys(exceptions?.rules ?? {}).length).toBeGreaterThan(0);\n });\n\n test('covers every rule oxlint cannot check inside an SFC', () => {\n expect(readVueUnsafeRules()).toEqual(expect.arrayContaining([...VUE_UNSAFE_FALLBACK]));\n });\n });\n\n describe('isRuleDisabled', () => {\n test.each([\n [undefined, true],\n ['off' as Linter.RuleEntry, true],\n [0 as Linter.RuleEntry, true],\n [['off'] as Linter.RuleEntry, true],\n ['error' as Linter.RuleEntry, false],\n [['error', { allow: [] }] as Linter.RuleEntry, false],\n [2 as Linter.RuleEntry, false],\n ])('%s → %s', (entry, expected) => {\n expect(isRuleDisabled(entry)).toBe(expected);\n });\n });\n}\n","export const removedOptions: ReadonlyMap<string, string> = new Map([\n [\n 'config',\n 'use `configFiles: string[]` instead. Its block is emitted after every scope block, so'\n + ' the overrides actually win; the `config` scope was emitted before them and was silently'\n + ' overridden for any file a language scope also matched.',\n ],\n]);\n\n/**\n * Renders the bullet list naming every removed option among `keys`, or `null` when none of them was\n * removed. Both the runtime rejection and the migration's refusal read this registry, so a consumer\n * who hits one after the other is given the same replacement rather than two wordings of it.\n * @example\n * describeRemovedOptions(['config']); // ' - `config`: use `configFiles: string[]` instead. …'\n * describeRemovedOptions(['strict']); // null\n */\nexport function describeRemovedOptions (keys: readonly string[]): string | null {\n const used = keys.filter(key => removedOptions.has(key));\n\n if (used.length === 0) {\n return null;\n }\n\n return used.map(key => ` - \\`${key}\\`: ${removedOptions.get(key)}`).join('\\n');\n}\n\n/* v8 ignore start */\nif (import.meta.vitest) {\n const { describe, test, expect } = import.meta.vitest;\n\n describe('describeRemovedOptions', () => {\n test('returns null when no key was removed', () => {\n expect(describeRemovedOptions(['ignores', 'strict', 'typescriptNode'])).toBeNull();\n });\n\n test('names the replacement for every registered removal', () => {\n [...removedOptions.keys()].forEach(key => {\n const described = describeRemovedOptions([key]);\n\n expect(described).toContain(`\\`${key}\\``);\n expect(described).toBe(` - \\`${key}\\`: ${removedOptions.get(key)}`);\n });\n });\n\n test('points `config` at configFiles', () => {\n expect(describeRemovedOptions(['config'])).toContain('`configFiles: string[]`');\n });\n\n test('lists one bullet per line, in the order the keys were given', () => {\n const described = describeRemovedOptions(['strict', ...removedOptions.keys()]);\n\n expect(described?.split('\\n')).toHaveLength(removedOptions.size);\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AACjC,IAAM,2BAA2B;AAEjC,IAAa,iBAAoC;CAAC;CAAY;CAAe;AAAY;AAEzF,IAAa,oBAAuC;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;AACH;AAMD,IAAa,2BAA8C,CAAC,uBAAuB;AAMnF,IAAa,0BAA6C,CAAC,uBAAuB;AAKlF,IAAM,sBAAyC;CAC3C;CACA;CACA;CACA;AACH;AAED,IAAM,6BAA+D;CACjE,YAAY;CACZ,QAAQ;CACR,sBAAsB;CACtB,GAAG;CACH,cAAc;CACd,eAAe;CACf,cAAc;CACd,YAAY;AACf;AAED,SAAS,iBAAkB,WAAkC;CACzD,OAAO,OAAO,OAAO,SAAS,CAAC,CAAC,SAAQ,UAAQ;EAC5C,IAAI,OAAO,UAAU,YAAY,UAAU,MACvC,OAAO,CAAA;EAGX,MAAM,UAAU,OAAO,QAAQ,KAAgC;EAG/D,OAFqB,QAAQ,SAAS,KAAK,QAAQ,OAAO,GAAG,cAAc,aAAa,KAAK,IAEvE,QAAQ,KAAK,CAAC,UAAU,IAAI,IAAI,CAAA;CAC1D,CAAC;AACL;AAEA,SAAS,cACL,WACA,SAAiC;CAEjC,OAAO,OAAO,YAAY,OAAO,QAAQ,SAAS,CAAC,CAAC,QAAQ,CAAC,SAAS,QAAQ,GAAG,CAAC,CAAC;AACvF;AAEA,IAAM,oBAAoBA;AAC1B,IAAM,iBAAiBC;AACvB,IAAM,mBAAmB,IAAI,IAAI,iB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M,SAAS,eAAe,MAAM,GAAG,eAAe,YAAY,GAAG,CAAC;CAEtE,OAAO,2BAA2B,WAAW;AACjD;AAEA,SAAgB,eAAgB,OAAmC;CAC/D,IAAI,UAAU,KAAA,GACV,OAAO;CAGX,MAAM,CAAC,YAAY,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;CAExD,OAAO,aAAa,SAAS,aAAa;AAC9C;;;AChLA,IAAa,iCAA8C,IAAI,IAAI,CAC/D,CACI,UACA,sOAGH,CACJ,CAAA;;;;;;;;;AAUD,SAAgB,uBAAwB,MAAuB;CAC3D,MAAM,OAAO,KAAK,QAAO,QAAO,eAAe,IAAI,GAAG,CAAC;CAEvD,IAAI,KAAK,WAAW,GAChB,OAAO;CAGX,OAAO,KAAK,KAAI,QAAO,SAAS,IAAG,MAAO,eAAe,IAAI,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;AAClF"}
|
|
@@ -10,10 +10,12 @@ var strict_default = require_merge.merge(eslint_plugin_sonarjs.configs.recommend
|
|
|
10
10
|
"sonarjs/todo-tag": ["warn"],
|
|
11
11
|
"sonarjs/no-useless-intersection": ["error"],
|
|
12
12
|
"sonarjs/cognitive-complexity": ["error", 10],
|
|
13
|
+
"sonarjs/no-nested-functions": ["error", { threshold: 4 }],
|
|
14
|
+
"sonarjs/no-vue-mixins": "off",
|
|
13
15
|
complexity: ["error", 10],
|
|
14
16
|
"max-depth": ["error", { max: 3 }]
|
|
15
17
|
} });
|
|
16
18
|
//#endregion
|
|
17
19
|
exports.default = strict_default;
|
|
18
20
|
|
|
19
|
-
//# sourceMappingURL=strict-
|
|
21
|
+
//# sourceMappingURL=strict-CF-NM1Kz.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-CF-NM1Kz.cjs","names":["merge","sonarJSConfigs"],"sources":["../src/configs/strict/index.ts"],"sourcesContent":["import type { Linter } from 'eslint';\nimport { configs as sonarJSConfigs } from 'eslint-plugin-sonarjs';\nimport { merge } from '~/utils/merge';\n\nexport default merge(\n sonarJSConfigs.recommended,\n {\n rules: {\n 'sonarjs/void-use': 'off',\n 'sonarjs/use-type-alias': 'off',\n 'sonarjs/no-redundant-optional': 'off',\n // Only matches aws-cdk-lib construct names, so it cannot report without that\n // dependency — but it still scans every call and new expression (~389 ms measured).\n 'sonarjs/aws-restricted-ip-admin-access': 'off',\n 'sonarjs/slow-regex': ['warn'],\n 'sonarjs/todo-tag': ['warn'],\n 'sonarjs/no-useless-intersection': ['error'],\n 'sonarjs/cognitive-complexity': ['error', 10],\n 'sonarjs/no-nested-functions': ['error', { threshold: 4 }],\n 'sonarjs/no-vue-mixins': 'off',\n complexity: ['error', 10],\n 'max-depth': ['error', { max: 3 }],\n },\n } satisfies Linter.Config\n);\n"],"mappings":";;;AAIA,IAAA,iBAAeA,cAAAA,MACXC,sBAAAA,QAAe,aACf,EACI,OAAO;CACH,oBAAoB;CACpB,0BAA0B;CAC1B,iCAAiC;CAGjC,0CAA0C;CAC1C,sBAAsB,CAAC,MAAM;CAC7B,oBAAoB,CAAC,MAAM;CAC3B,mCAAmC,CAAC,OAAO;CAC3C,gCAAgC,CAAC,SAAS,EAAE;CAC5C,+BAA+B,CAAC,SAAS,EAAE,WAAW,EAAC,CAAE;CACzD,yBAAyB;CACzB,YAAY,CAAC,SAAS,EAAE;CACxB,aAAa,CAAC,SAAS,EAAE,KAAK,EAAC,CAAE;AACpC,EACoB,CAAA"}
|
|
@@ -10,10 +10,12 @@ var strict_default = merge(configs.recommended, { rules: {
|
|
|
10
10
|
"sonarjs/todo-tag": ["warn"],
|
|
11
11
|
"sonarjs/no-useless-intersection": ["error"],
|
|
12
12
|
"sonarjs/cognitive-complexity": ["error", 10],
|
|
13
|
+
"sonarjs/no-nested-functions": ["error", { threshold: 4 }],
|
|
14
|
+
"sonarjs/no-vue-mixins": "off",
|
|
13
15
|
complexity: ["error", 10],
|
|
14
16
|
"max-depth": ["error", { max: 3 }]
|
|
15
17
|
} });
|
|
16
18
|
//#endregion
|
|
17
19
|
export { strict_default as default };
|
|
18
20
|
|
|
19
|
-
//# sourceMappingURL=strict-
|
|
21
|
+
//# sourceMappingURL=strict-DSSQSR-R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-DSSQSR-R.js","names":["sonarJSConfigs"],"sources":["../src/configs/strict/index.ts"],"sourcesContent":["import type { Linter } from 'eslint';\nimport { configs as sonarJSConfigs } from 'eslint-plugin-sonarjs';\nimport { merge } from '~/utils/merge';\n\nexport default merge(\n sonarJSConfigs.recommended,\n {\n rules: {\n 'sonarjs/void-use': 'off',\n 'sonarjs/use-type-alias': 'off',\n 'sonarjs/no-redundant-optional': 'off',\n // Only matches aws-cdk-lib construct names, so it cannot report without that\n // dependency — but it still scans every call and new expression (~389 ms measured).\n 'sonarjs/aws-restricted-ip-admin-access': 'off',\n 'sonarjs/slow-regex': ['warn'],\n 'sonarjs/todo-tag': ['warn'],\n 'sonarjs/no-useless-intersection': ['error'],\n 'sonarjs/cognitive-complexity': ['error', 10],\n 'sonarjs/no-nested-functions': ['error', { threshold: 4 }],\n 'sonarjs/no-vue-mixins': 'off',\n complexity: ['error', 10],\n 'max-depth': ['error', { max: 3 }],\n },\n } satisfies Linter.Config\n);\n"],"mappings":";;;AAIA,IAAA,iBAAe,MACXA,QAAe,aACf,EACI,OAAO;CACH,oBAAoB;CACpB,0BAA0B;CAC1B,iCAAiC;CAGjC,0CAA0C;CAC1C,sBAAsB,CAAC,MAAM;CAC7B,oBAAoB,CAAC,MAAM;CAC3B,mCAAmC,CAAC,OAAO;CAC3C,gCAAgC,CAAC,SAAS,EAAE;CAC5C,+BAA+B,CAAC,SAAS,EAAE,WAAW,EAAC,CAAE;CACzD,yBAAyB;CACzB,YAAY,CAAC,SAAS,EAAE;CACxB,aAAa,CAAC,SAAS,EAAE,KAAK,EAAC,CAAE;AACpC,EACoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylistic-B2hCwBRu.cjs","names":[],"sources":["../src/rules/jsdoc.ts","../src/base.ts","../src/rules/core.ts","../src/rules/cspell.ts","../src/rules/importRules.ts","../src/rules/stylistic.ts"],"sourcesContent":["import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n 'jsdoc/check-param-names': ['error'],\n 'jsdoc/check-tag-names': ['error'],\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param': ['error', {\n enableRestElementFixer: false,\n enableRootFixer: false,\n }],\n 'jsdoc/require-jsdoc': ['off'],\n 'jsdoc/require-param-description': 'off',\n 'jsdoc/require-param-type': ['error'],\n 'jsdoc/require-property-description': 'off',\n 'jsdoc/require-returns': ['error', {\n contexts: ['TSInterfaceDeclaration', 'TSMethodSignature'],\n forceRequireReturn: true,\n exemptedBy: ['inheritdoc', 'watch'],\n }],\n 'jsdoc/require-returns-check': ['error'],\n 'jsdoc/require-returns-description': 'off',\n 'jsdoc/tag-lines': ['error'],\n 'jsdoc/valid-types': 'off',\n 'jsdoc/check-types': ['error'],\n 'jsdoc/no-multi-asterisks': ['error'],\n 'jsdoc/check-alignment': ['error'],\n 'jsdoc/sort-tags': ['error', {\n linesBetween: 1,\n tagSequence: [{\n tags: [\n 'todo',\n 'description',\n 'deprecated',\n 'namespace',\n 'private',\n 'protected',\n 'public',\n 'static',\n 'readonly',\n 'since',\n 'access',\n 'template',\n 'typedef',\n 'class',\n 'augments',\n 'mixes',\n 'extends',\n 'interface',\n 'this',\n 'constructor',\n 'alias',\n 'memberof',\n 'example',\n 'use',\n 'see',\n 'link',\n 'global',\n 'fires',\n 'listens',\n 'type',\n 'param',\n 'property',\n 'yields',\n 'returns',\n 'lends',\n 'override',\n 'todo',\n ],\n }],\n }],\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\nimport cspellESLintPluginRecommended from '@cspell/eslint-plugin/recommended';\nimport js from '@eslint/js';\nimport jsdoc from './rules/jsdoc';\nimport { merge } from './utils/merge';\n\nexport function preConfig () {\n return merge(\n js.configs.recommended as Linter.Config,\n cspellESLintPluginRecommended as Linter.Config\n );\n}\n\nexport function postConfig (): Linter.Config {\n return merge(\n jsdoc,\n {\n languageOptions: {\n ecmaVersion: 2022,\n parserOptions: {\n ecmaVersion: 2022,\n },\n },\n rules: {\n 'jsdoc/require-param': 'off',\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-returns': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/check-param-names': 'off',\n },\n } satisfies Linter.Config\n );\n}\n","import type { Linter } from 'eslint';\nimport type { Entries } from 'type-fest';\n\n// InToasts is intentionally absent from DS_V1_TO_V2 — ToastV2 replacement not yet exported from DS v1.2.0.\nconst DS_V1_TO_V2_MAP = {\n InBox: 'InContainer',\n InButton: 'InButtonV2',\n InCheckBox: 'InCheckBoxV2',\n InCustomDropDown: 'InDropdownMenu',\n InDataTable: 'InDataTableV2',\n InDatePicker: 'InDatePickerV2',\n InDropDown: 'InSelect',\n InModals: 'InModalV2',\n InMultiDropDown: 'InMultiSelect',\n InSidebar: 'InSidebarV2',\n InSuperInput: 'InRichTextInput',\n InTagsText: 'InChips',\n InTextInput: 'InBasicTextInput',\n InTooltip: 'InTooltipV2',\n} as const;\n\nconst DS_V1_TO_V2 = (Object.entries(DS_V1_TO_V2_MAP) as Entries<typeof DS_V1_TO_V2_MAP>).map(([v1, v2]) => ({\n name: '@useinsider/design-system-vue',\n importNames: [v1],\n message: `It is marked as deprecated. Use '${v2}' instead.` as const,\n} as const));\n\nconst overriddenRules: Linter.RulesRecord = {\n // https://eslint.style/rules/js/function-call-spacing\n 'no-spaced-func': 'off',\n};\n\nexport default {\n rules: {\n ...overriddenRules,\n 'arrow-parens': 'off',\n camelcase: ['error', {\n allow: ['^\\\\$_'],\n properties: 'never',\n }],\n 'comma-dangle': 'off',\n 'consistent-return': ['error'],\n 'class-methods-use-this': 'off',\n curly: ['error', 'all'],\n 'dot-notation': ['error'],\n 'function-paren-newline': 'off',\n 'guard-for-in': 'error',\n 'handle-callback-err': ['error'],\n indent: 'off',\n 'max-len': 'off',\n 'new-cap': ['error'],\n 'no-alert': ['error'],\n 'no-bitwise': ['error', {\n allow: ['~'],\n }],\n 'no-caller': ['error'],\n 'no-case-declarations': ['error'],\n 'no-confusing-arrow': ['error', {\n allowParens: true,\n }],\n 'no-console': ['error'],\n 'no-debugger': ['error'],\n 'no-div-regex': ['error'],\n 'no-dupe-args': ['error'],\n 'no-dupe-keys': ['error'],\n 'no-duplicate-case': ['error'],\n 'no-else-return': ['error'],\n 'no-empty': ['error'],\n 'no-extra-bind': ['error'],\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': ['error'],\n 'no-implicit-coercion': ['error', {\n boolean: true,\n number: true,\n string: true,\n }],\n 'implicit-arrow-linebreak': 'off',\n 'no-invalid-regexp': ['error'],\n 'no-iterator': ['error'],\n 'no-mixed-operators': 'off',\n 'no-multi-spaces': 'off',\n 'no-multi-str': ['error'],\n 'no-multiple-empty-lines': 'off',\n 'no-native-reassign': 'error',\n 'no-nested-ternary': ['error'],\n 'no-new': 'off',\n 'no-new-object': ['error'],\n 'no-new-require': ['error'],\n 'no-param-reassign': ['error', {\n props: false,\n }],\n 'no-plusplus': 'off',\n 'no-process-exit': ['error'],\n 'no-promise-executor-return': ['error', {\n allowVoid: true,\n }],\n 'no-return-assign': ['error', 'except-parens'],\n 'no-self-compare': ['error'],\n 'no-sequences': ['error'],\n 'no-shadow': ['error', {\n allow: ['state'],\n }],\n 'no-undef': ['error'],\n 'no-underscore-dangle': 'off',\n 'no-unexpected-multiline': ['error'],\n 'no-unreachable': ['error'],\n 'no-unused-vars': ['error'],\n 'no-use-before-define': 'error',\n 'no-useless-call': ['error'],\n 'no-void': 'off',\n 'no-with': ['error'],\n 'object-curly-newline': 'off',\n 'object-shorthand': ['error', 'always'],\n 'padded-blocks': 'off',\n 'prefer-const': ['error', {\n destructuring: 'all',\n }],\n 'prefer-destructuring': ['error'],\n radix: ['error', 'as-needed'],\n semi: 'off',\n 'space-before-function-paren': 'off',\n 'space-in-parens': 'off',\n strict: ['error', 'never'],\n 'use-isnan': ['error'],\n 'valid-typeof': ['error'],\n 'no-trailing-spaces': 'off',\n 'no-restricted-imports': ['error', {\n paths: DS_V1_TO_V2,\n }],\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n '@cspell/spellchecker': ['error', {\n customWordListFile: './cspell.json',\n }],\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n 'import-x/extensions': ['error', {\n css: 'always',\n js: 'never',\n json: 'always',\n jsx: 'never',\n sass: 'always',\n scss: 'always',\n svg: 'always',\n ts: 'never',\n tsx: 'never',\n vue: 'always',\n }],\n 'import-x/no-cycle': 'off',\n 'import-x/no-unresolved': 'off',\n 'import-x/order': ['error', {\n alphabetize: {\n caseInsensitive: true,\n order: 'asc',\n },\n groups: ['index', 'builtin', 'object', 'type', 'external', 'parent', 'internal', 'sibling'],\n pathGroups: [{\n group: 'internal',\n pattern: '@/**',\n }],\n }],\n 'import-x/prefer-default-export': 'off',\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n '@stylistic/array-bracket-newline': ['error', 'consistent'],\n '@stylistic/array-bracket-spacing': ['error', 'never'],\n '@stylistic/array-element-newline': ['error', 'consistent'],\n '@stylistic/arrow-parens': ['error', 'as-needed'],\n '@stylistic/arrow-spacing': ['error'],\n '@stylistic/brace-style': ['error', '1tbs'],\n '@stylistic/comma-dangle': ['error', {\n arrays: 'always-multiline',\n exports: 'always-multiline',\n functions: 'never',\n imports: 'always-multiline',\n objects: 'always-multiline',\n enums: 'always-multiline',\n generics: 'always-multiline',\n tuples: 'always-multiline',\n }],\n '@stylistic/comma-spacing': ['error'],\n '@stylistic/computed-property-spacing': ['error'],\n '@stylistic/dot-location': ['error', 'property'],\n '@stylistic/eol-last': ['error', 'always'],\n '@stylistic/function-call-argument-newline': ['error', 'consistent'],\n '@stylistic/function-call-spacing': ['error', 'never'],\n '@stylistic/function-paren-newline': ['error', 'consistent'],\n '@stylistic/implicit-arrow-linebreak': ['error', 'beside'],\n '@stylistic/indent': ['error', 4, {\n SwitchCase: 1,\n ignoredNodes: [\n 'PropertyDefinition[decorators]',\n 'TSUnionType',\n ],\n }],\n '@stylistic/key-spacing': ['error'],\n '@stylistic/keyword-spacing': ['error'],\n '@stylistic/linebreak-style': ['error', 'unix'],\n '@stylistic/lines-between-class-members': ['error', 'always', {\n exceptAfterSingleLine: true,\n }],\n '@stylistic/max-len': ['error', 120, {\n ignoreComments: true,\n ignoreRegExpLiterals: true,\n ignoreTrailingComments: true,\n ignoreUrls: true,\n }],\n '@stylistic/max-statements-per-line': ['error', {\n max: 2,\n }],\n '@stylistic/member-delimiter-style': ['error', {\n multiline: {\n requireLast: true,\n },\n singleline: {\n requireLast: false,\n },\n }],\n '@stylistic/multiline-ternary': ['error', 'always-multiline'],\n '@stylistic/new-parens': ['error', 'always'],\n '@stylistic/no-extra-parens': ['error', 'all', {\n allowParensAfterCommentPattern: '@type|@satisfies',\n ignoredNodes: [\n \"ArrowFunctionExpression[body.type='ConditionalExpression']\",\n 'TSUnionType',\n 'TSTypeAnnotation:has(> TSUnionType)',\n 'TSTypeAliasDeclaration:has(> TSUnionType)',\n 'TSIntersectionType',\n 'TSTypeAnnotation:has(> TSIntersectionType)',\n 'TSTypeAliasDeclaration:has(> TSIntersectionType)',\n ],\n nestedBinaryExpressions: false,\n returnAssign: false,\n }],\n '@stylistic/no-extra-semi': ['error'],\n '@stylistic/no-floating-decimal': 'error',\n '@stylistic/no-mixed-operators': ['error', {\n allowSamePrecedence: true,\n groups: [\n ['&', '|', '^', '~', '<<', '>>', '>>>'],\n ['==', '!=', '===', '!==', '>', '>=', '<', '<='],\n ['&&', '||'],\n ['in', 'instanceof'],\n ],\n }],\n '@stylistic/no-mixed-spaces-and-tabs': ['error'],\n '@stylistic/no-multi-spaces': ['error'],\n '@stylistic/no-multiple-empty-lines': ['error', {\n max: 1,\n maxEOF: 0,\n maxBOF: 0,\n }],\n '@stylistic/no-trailing-spaces': ['error'],\n '@stylistic/no-whitespace-before-property': ['error'],\n '@stylistic/object-curly-newline': ['error', {\n multiline: true,\n consistent: true,\n }],\n '@stylistic/object-curly-spacing': ['error', 'always'],\n '@stylistic/padded-blocks': ['error', 'never'],\n '@stylistic/quote-props': ['error', 'as-needed'],\n '@stylistic/quotes': ['error', 'single', {\n avoidEscape: true,\n }],\n '@stylistic/rest-spread-spacing': ['error', 'never'],\n '@stylistic/semi': ['error'],\n '@stylistic/semi-spacing': ['error', {\n after: true,\n before: false,\n }],\n '@stylistic/semi-style': ['error', 'last'],\n '@stylistic/space-before-blocks': ['error'],\n '@stylistic/space-before-function-paren': ['error', {\n anonymous: 'always',\n named: 'always',\n }],\n '@stylistic/space-in-parens': ['error', 'never'],\n '@stylistic/space-infix-ops': ['error'],\n '@stylistic/spaced-comment': ['error', 'always', {\n markers: ['/'],\n }],\n '@stylistic/template-curly-spacing': ['error', 'never'],\n '@stylistic/template-tag-spacing': ['error', 'never'],\n '@stylistic/type-annotation-spacing': ['error'],\n '@stylistic/type-generic-spacing': ['error'],\n '@stylistic/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: '*',\n prev: ['const', 'let', 'var', 'if', 'block-like', 'directive'],\n },\n {\n blankLine: 'always',\n next: [\n 'const',\n 'let',\n 'var',\n 'if',\n 'while',\n 'directive',\n 'throw',\n 'return',\n 'break',\n 'default',\n 'cjs-export',\n 'export',\n 'continue',\n 'iife',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n prev: ['*'],\n next: ['cjs-export', 'export'],\n },\n {\n blankLine: 'any',\n next: ['const', 'let', 'var', 'directive'],\n prev: ['const', 'let', 'var', 'directive'],\n },\n {\n blankLine: 'never',\n next: ['singleline-const', 'singleline-let', 'singleline-var'],\n prev: ['singleline-const', 'singleline-let', 'singleline-var'],\n },\n {\n blankLine: 'always',\n next: ['multiline-block-like'],\n prev: ['*'],\n },\n {\n blankLine: 'always',\n next: ['*'],\n prev: ['multiline-block-like'],\n },\n {\n blankLine: 'any',\n next: ['case'],\n prev: ['case'],\n },\n {\n blankLine: 'any',\n next: ['singleline-const', 'singleline-let', 'singleline-var'],\n prev: ['cjs-import'],\n },\n ],\n },\n} as Linter.Config;\n"],"mappings":";;;;;;;AAEA,IAAA,gBAAe,EACX,OAAO;CACH,2BAA2B,CAAC,OAAO;CACnC,yBAAyB,CAAC,OAAO;CACjC,4BAA4B;CAC5B,uBAAuB,CAAC,SAAS;EAC7B,wBAAwB;EACxB,iBAAiB;CACpB,CAAA;CACD,uBAAuB,CAAC,KAAK;CAC7B,mCAAmC;CACnC,4BAA4B,CAAC,OAAO;CACpC,sCAAsC;CACtC,yBAAyB,CAAC,SAAS;EAC/B,UAAU,CAAC,0BAA0B,mBAAmB;EACxD,oBAAoB;EACpB,YAAY,CAAC,cAAc,OAAO;CACrC,CAAA;CACD,+BAA+B,CAAC,OAAO;CACvC,qCAAqC;CACrC,mBAAmB,CAAC,OAAO;CAC3B,qBAAqB;CACrB,qBAAqB,CAAC,OAAO;CAC7B,4BAA4B,CAAC,OAAO;CACpC,yBAAyB,CAAC,OAAO;CACjC,mBAAmB,CAAC,SAAS;EACzB,cAAc;EACd,aAAa,CAAC,EACV,MAAM;GACF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACH,EACJ,CAAA;CACJ,CAAA;AACJ,EACa;;;AClElB,SAAgB,YAAS;CACrB,OAAO,cAAA,MACH,WAAA,QAAG,QAAQ,aACX,kCAAA,OAA8C;AAEtD;AAEA,SAAgB,aAAU;CACtB,OAAO,cAAA,MACH,eACA;EACI,iBAAiB;GACb,aAAa;GACb,eAAe,EACX,aAAa,KAChB;EACJ;EACD,O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;AACJ,EACa"}
|
|
1
|
+
{"version":3,"file":"stylistic-B2hCwBRu.cjs","names":["merge","js","cspellESLintPluginRecommended","jsdoc"],"sources":["../src/rules/jsdoc.ts","../src/base.ts","../src/rules/core.ts","../src/rules/cspell.ts","../src/rules/importRules.ts","../src/rules/stylistic.ts"],"sourcesContent":["import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n 'jsdoc/check-param-names': ['error'],\n 'jsdoc/check-tag-names': ['error'],\n 'jsdoc/no-undefined-types': 'off',\n 'jsdoc/require-param': ['error', {\n enableRestElementFixer: false,\n enableRootFixer: false,\n }],\n 'jsdoc/require-jsdoc': ['off'],\n 'jsdoc/require-param-description': 'off',\n 'jsdoc/require-param-type': ['error'],\n 'jsdoc/require-property-description': 'off',\n 'jsdoc/require-returns': ['error', {\n contexts: ['TSInterfaceDeclaration', 'TSMethodSignature'],\n forceRequireReturn: true,\n exemptedBy: ['inheritdoc', 'watch'],\n }],\n 'jsdoc/require-returns-check': ['error'],\n 'jsdoc/require-returns-description': 'off',\n 'jsdoc/tag-lines': ['error'],\n 'jsdoc/valid-types': 'off',\n 'jsdoc/check-types': ['error'],\n 'jsdoc/no-multi-asterisks': ['error'],\n 'jsdoc/check-alignment': ['error'],\n 'jsdoc/sort-tags': ['error', {\n linesBetween: 1,\n tagSequence: [{\n tags: [\n 'todo',\n 'description',\n 'deprecated',\n 'namespace',\n 'private',\n 'protected',\n 'public',\n 'static',\n 'readonly',\n 'since',\n 'access',\n 'template',\n 'typedef',\n 'class',\n 'augments',\n 'mixes',\n 'extends',\n 'interface',\n 'this',\n 'constructor',\n 'alias',\n 'memberof',\n 'example',\n 'use',\n 'see',\n 'link',\n 'global',\n 'fires',\n 'listens',\n 'type',\n 'param',\n 'property',\n 'yields',\n 'returns',\n 'lends',\n 'override',\n 'todo',\n ],\n }],\n }],\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\nimport cspellESLintPluginRecommended from '@cspell/eslint-plugin/recommended';\nimport js from '@eslint/js';\nimport jsdoc from './rules/jsdoc';\nimport { merge } from './utils/merge';\n\nexport function preConfig () {\n return merge(\n js.configs.recommended as Linter.Config,\n cspellESLintPluginRecommended as Linter.Config\n );\n}\n\nexport function postConfig (): Linter.Config {\n return merge(\n jsdoc,\n {\n languageOptions: {\n ecmaVersion: 2022,\n parserOptions: {\n ecmaVersion: 2022,\n },\n },\n rules: {\n 'jsdoc/require-param': 'off',\n 'jsdoc/require-jsdoc': 'off',\n 'jsdoc/require-returns': 'off',\n 'jsdoc/require-param-type': 'off',\n 'jsdoc/check-param-names': 'off',\n },\n } satisfies Linter.Config\n );\n}\n","import type { Linter } from 'eslint';\nimport type { Entries } from 'type-fest';\n\n// InToasts is intentionally absent from DS_V1_TO_V2 — ToastV2 replacement not yet exported from DS v1.2.0.\nconst DS_V1_TO_V2_MAP = {\n InBox: 'InContainer',\n InButton: 'InButtonV2',\n InCheckBox: 'InCheckBoxV2',\n InCustomDropDown: 'InDropdownMenu',\n InDataTable: 'InDataTableV2',\n InDatePicker: 'InDatePickerV2',\n InDropDown: 'InSelect',\n InModals: 'InModalV2',\n InMultiDropDown: 'InMultiSelect',\n InSidebar: 'InSidebarV2',\n InSuperInput: 'InRichTextInput',\n InTagsText: 'InChips',\n InTextInput: 'InBasicTextInput',\n InTooltip: 'InTooltipV2',\n} as const;\n\nconst DS_V1_TO_V2 = (Object.entries(DS_V1_TO_V2_MAP) as Entries<typeof DS_V1_TO_V2_MAP>).map(([v1, v2]) => ({\n name: '@useinsider/design-system-vue',\n importNames: [v1],\n message: `It is marked as deprecated. Use '${v2}' instead.` as const,\n} as const));\n\nconst overriddenRules: Linter.RulesRecord = {\n // https://eslint.style/rules/js/function-call-spacing\n 'no-spaced-func': 'off',\n};\n\nexport default {\n rules: {\n ...overriddenRules,\n 'arrow-parens': 'off',\n camelcase: ['error', {\n allow: ['^\\\\$_'],\n properties: 'never',\n }],\n 'comma-dangle': 'off',\n 'consistent-return': ['error'],\n 'class-methods-use-this': 'off',\n curly: ['error', 'all'],\n 'dot-notation': ['error'],\n 'function-paren-newline': 'off',\n 'guard-for-in': 'error',\n 'handle-callback-err': ['error'],\n indent: 'off',\n 'max-len': 'off',\n 'new-cap': ['error'],\n 'no-alert': ['error'],\n 'no-bitwise': ['error', {\n allow: ['~'],\n }],\n 'no-caller': ['error'],\n 'no-case-declarations': ['error'],\n 'no-confusing-arrow': ['error', {\n allowParens: true,\n }],\n 'no-console': ['error'],\n 'no-debugger': ['error'],\n 'no-div-regex': ['error'],\n 'no-dupe-args': ['error'],\n 'no-dupe-keys': ['error'],\n 'no-duplicate-case': ['error'],\n 'no-else-return': ['error'],\n 'no-empty': ['error'],\n 'no-extra-bind': ['error'],\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': ['error'],\n 'no-implicit-coercion': ['error', {\n boolean: true,\n number: true,\n string: true,\n }],\n 'implicit-arrow-linebreak': 'off',\n 'no-invalid-regexp': ['error'],\n 'no-iterator': ['error'],\n 'no-mixed-operators': 'off',\n 'no-multi-spaces': 'off',\n 'no-multi-str': ['error'],\n 'no-multiple-empty-lines': 'off',\n 'no-native-reassign': 'error',\n 'no-nested-ternary': ['error'],\n 'no-new': 'off',\n 'no-new-object': ['error'],\n 'no-new-require': ['error'],\n 'no-param-reassign': ['error', {\n props: false,\n }],\n 'no-plusplus': 'off',\n 'no-process-exit': ['error'],\n 'no-promise-executor-return': ['error', {\n allowVoid: true,\n }],\n 'no-return-assign': ['error', 'except-parens'],\n 'no-self-compare': ['error'],\n 'no-sequences': ['error'],\n 'no-shadow': ['error', {\n allow: ['state'],\n }],\n 'no-undef': ['error'],\n 'no-underscore-dangle': 'off',\n 'no-unexpected-multiline': ['error'],\n 'no-unreachable': ['error'],\n 'no-unused-vars': ['error'],\n 'no-use-before-define': 'error',\n 'no-useless-call': ['error'],\n 'no-void': 'off',\n 'no-with': ['error'],\n 'object-curly-newline': 'off',\n 'object-shorthand': ['error', 'always'],\n 'padded-blocks': 'off',\n 'prefer-const': ['error', {\n destructuring: 'all',\n }],\n 'prefer-destructuring': ['error'],\n radix: ['error', 'as-needed'],\n semi: 'off',\n 'space-before-function-paren': 'off',\n 'space-in-parens': 'off',\n strict: ['error', 'never'],\n 'use-isnan': ['error'],\n 'valid-typeof': ['error'],\n 'no-trailing-spaces': 'off',\n 'no-restricted-imports': ['error', {\n paths: DS_V1_TO_V2,\n }],\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n '@cspell/spellchecker': ['error', {\n customWordListFile: './cspell.json',\n }],\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n 'import-x/extensions': ['error', {\n css: 'always',\n js: 'never',\n json: 'always',\n jsx: 'never',\n sass: 'always',\n scss: 'always',\n svg: 'always',\n ts: 'never',\n tsx: 'never',\n vue: 'always',\n }],\n 'import-x/no-cycle': 'off',\n 'import-x/no-unresolved': 'off',\n 'import-x/order': ['error', {\n alphabetize: {\n caseInsensitive: true,\n order: 'asc',\n },\n groups: ['index', 'builtin', 'object', 'type', 'external', 'parent', 'internal', 'sibling'],\n pathGroups: [{\n group: 'internal',\n pattern: '@/**',\n }],\n }],\n 'import-x/prefer-default-export': 'off',\n },\n} as Linter.Config;\n","import type { Linter } from 'eslint';\n\nexport default {\n rules: {\n '@stylistic/array-bracket-newline': ['error', 'consistent'],\n '@stylistic/array-bracket-spacing': ['error', 'never'],\n '@stylistic/array-element-newline': ['error', 'consistent'],\n '@stylistic/arrow-parens': ['error', 'as-needed'],\n '@stylistic/arrow-spacing': ['error'],\n '@stylistic/brace-style': ['error', '1tbs'],\n '@stylistic/comma-dangle': ['error', {\n arrays: 'always-multiline',\n exports: 'always-multiline',\n functions: 'never',\n imports: 'always-multiline',\n objects: 'always-multiline',\n enums: 'always-multiline',\n generics: 'always-multiline',\n tuples: 'always-multiline',\n }],\n '@stylistic/comma-spacing': ['error'],\n '@stylistic/computed-property-spacing': ['error'],\n '@stylistic/dot-location': ['error', 'property'],\n '@stylistic/eol-last': ['error', 'always'],\n '@stylistic/function-call-argument-newline': ['error', 'consistent'],\n '@stylistic/function-call-spacing': ['error', 'never'],\n '@stylistic/function-paren-newline': ['error', 'consistent'],\n '@stylistic/implicit-arrow-linebreak': ['error', 'beside'],\n '@stylistic/indent': ['error', 4, {\n SwitchCase: 1,\n ignoredNodes: [\n 'PropertyDefinition[decorators]',\n 'TSUnionType',\n ],\n }],\n '@stylistic/key-spacing': ['error'],\n '@stylistic/keyword-spacing': ['error'],\n '@stylistic/linebreak-style': ['error', 'unix'],\n '@stylistic/lines-between-class-members': ['error', 'always', {\n exceptAfterSingleLine: true,\n }],\n '@stylistic/max-len': ['error', 120, {\n ignoreComments: true,\n ignoreRegExpLiterals: true,\n ignoreTrailingComments: true,\n ignoreUrls: true,\n }],\n '@stylistic/max-statements-per-line': ['error', {\n max: 2,\n }],\n '@stylistic/member-delimiter-style': ['error', {\n multiline: {\n requireLast: true,\n },\n singleline: {\n requireLast: false,\n },\n }],\n '@stylistic/multiline-ternary': ['error', 'always-multiline'],\n '@stylistic/new-parens': ['error', 'always'],\n '@stylistic/no-extra-parens': ['error', 'all', {\n allowParensAfterCommentPattern: '@type|@satisfies',\n ignoredNodes: [\n \"ArrowFunctionExpression[body.type='ConditionalExpression']\",\n 'TSUnionType',\n 'TSTypeAnnotation:has(> TSUnionType)',\n 'TSTypeAliasDeclaration:has(> TSUnionType)',\n 'TSIntersectionType',\n 'TSTypeAnnotation:has(> TSIntersectionType)',\n 'TSTypeAliasDeclaration:has(> TSIntersectionType)',\n ],\n nestedBinaryExpressions: false,\n returnAssign: false,\n }],\n '@stylistic/no-extra-semi': ['error'],\n '@stylistic/no-floating-decimal': 'error',\n '@stylistic/no-mixed-operators': ['error', {\n allowSamePrecedence: true,\n groups: [\n ['&', '|', '^', '~', '<<', '>>', '>>>'],\n ['==', '!=', '===', '!==', '>', '>=', '<', '<='],\n ['&&', '||'],\n ['in', 'instanceof'],\n ],\n }],\n '@stylistic/no-mixed-spaces-and-tabs': ['error'],\n '@stylistic/no-multi-spaces': ['error'],\n '@stylistic/no-multiple-empty-lines': ['error', {\n max: 1,\n maxEOF: 0,\n maxBOF: 0,\n }],\n '@stylistic/no-trailing-spaces': ['error'],\n '@stylistic/no-whitespace-before-property': ['error'],\n '@stylistic/object-curly-newline': ['error', {\n multiline: true,\n consistent: true,\n }],\n '@stylistic/object-curly-spacing': ['error', 'always'],\n '@stylistic/padded-blocks': ['error', 'never'],\n '@stylistic/quote-props': ['error', 'as-needed'],\n '@stylistic/quotes': ['error', 'single', {\n avoidEscape: true,\n }],\n '@stylistic/rest-spread-spacing': ['error', 'never'],\n '@stylistic/semi': ['error'],\n '@stylistic/semi-spacing': ['error', {\n after: true,\n before: false,\n }],\n '@stylistic/semi-style': ['error', 'last'],\n '@stylistic/space-before-blocks': ['error'],\n '@stylistic/space-before-function-paren': ['error', {\n anonymous: 'always',\n named: 'always',\n }],\n '@stylistic/space-in-parens': ['error', 'never'],\n '@stylistic/space-infix-ops': ['error'],\n '@stylistic/spaced-comment': ['error', 'always', {\n markers: ['/'],\n }],\n '@stylistic/template-curly-spacing': ['error', 'never'],\n '@stylistic/template-tag-spacing': ['error', 'never'],\n '@stylistic/type-annotation-spacing': ['error'],\n '@stylistic/type-generic-spacing': ['error'],\n '@stylistic/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: '*',\n prev: ['const', 'let', 'var', 'if', 'block-like', 'directive'],\n },\n {\n blankLine: 'always',\n next: [\n 'const',\n 'let',\n 'var',\n 'if',\n 'while',\n 'directive',\n 'throw',\n 'return',\n 'break',\n 'default',\n 'cjs-export',\n 'export',\n 'continue',\n 'iife',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n prev: ['*'],\n next: ['cjs-export', 'export'],\n },\n {\n blankLine: 'any',\n next: ['const', 'let', 'var', 'directive'],\n prev: ['const', 'let', 'var', 'directive'],\n },\n {\n blankLine: 'never',\n next: ['singleline-const', 'singleline-let', 'singleline-var'],\n prev: ['singleline-const', 'singleline-let', 'singleline-var'],\n },\n {\n blankLine: 'always',\n next: ['multiline-block-like'],\n prev: ['*'],\n },\n {\n blankLine: 'always',\n next: ['*'],\n prev: ['multiline-block-like'],\n },\n {\n blankLine: 'any',\n next: ['case'],\n prev: ['case'],\n },\n {\n blankLine: 'any',\n next: ['singleline-const', 'singleline-let', 'singleline-var'],\n prev: ['cjs-import'],\n },\n ],\n },\n} as Linter.Config;\n"],"mappings":";;;;;;;AAEA,IAAA,gBAAe,EACX,OAAO;CACH,2BAA2B,CAAC,OAAO;CACnC,yBAAyB,CAAC,OAAO;CACjC,4BAA4B;CAC5B,uBAAuB,CAAC,SAAS;EAC7B,wBAAwB;EACxB,iBAAiB;CACpB,CAAA;CACD,uBAAuB,CAAC,KAAK;CAC7B,mCAAmC;CACnC,4BAA4B,CAAC,OAAO;CACpC,sCAAsC;CACtC,yBAAyB,CAAC,SAAS;EAC/B,UAAU,CAAC,0BAA0B,mBAAmB;EACxD,oBAAoB;EACpB,YAAY,CAAC,cAAc,OAAO;CACrC,CAAA;CACD,+BAA+B,CAAC,OAAO;CACvC,qCAAqC;CACrC,mBAAmB,CAAC,OAAO;CAC3B,qBAAqB;CACrB,qBAAqB,CAAC,OAAO;CAC7B,4BAA4B,CAAC,OAAO;CACpC,yBAAyB,CAAC,OAAO;CACjC,mBAAmB,CAAC,SAAS;EACzB,cAAc;EACd,aAAa,CAAC,EACV,MAAM;GACF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACH,EACJ,CAAA;CACJ,CAAA;AACJ,EACa;;;AClElB,SAAgB,YAAS;CACrB,OAAOA,cAAAA,MACHC,WAAAA,QAAG,QAAQ,aACXC,kCAAAA,OAA8C;AAEtD;AAEA,SAAgB,aAAU;CACtB,OAAOF,cA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