@sanity/plugin-kit
7.0.28.0.0
dist/oxlint.js.map+
dist/oxlint.js.mapNew file+1
Index: package/dist/oxlint.js.map
===================================================================
--- package/dist/oxlint.js.map
+++ package/dist/oxlint.js.map
@@ -0,0 +1,1 @@
+{"version":3,"file":"oxlint.js","names":[],"sources":["../src/oxlint.ts"],"sourcesContent":["import type {OxlintConfig} from 'oxlint'\n\n/**\n * Shared [oxlint](https://oxc.rs/docs/guide/usage/linter.html) config for Sanity plugins - the\n * same settings the [sanity-io/plugins](https://github.com/sanity-io/plugins) monorepo uses:\n * type-aware rules and TypeScript type checking enabled (via `oxlint-tsgolint`), warnings denied,\n * and the React, React Compiler, import, promise, a11y and unicorn rule sets turned on.\n *\n * Re-export it from an `oxlint.config.ts` next to the `package.json` that runs oxlint (the\n * repository root in a monorepo, otherwise the plugin directory):\n *\n * ```ts\n * export {default} from '@sanity/plugin-kit/oxlint'\n * ```\n *\n * To customize, extend it and add your own options ([`ignorePatterns` do not propagate through\n * `extends`](https://oxc.rs/docs/guide/usage/linter/config.html#extend-shared-configs), so spread\n * them explicitly when adding your own):\n *\n * ```ts\n * import sanityPluginKitOxlint from '@sanity/plugin-kit/oxlint'\n * import {defineConfig} from 'oxlint'\n *\n * export default defineConfig({\n * extends: [sanityPluginKitOxlint],\n * ignorePatterns: [...(sanityPluginKitOxlint.ignorePatterns ?? []), 'examples/**'],\n * })\n * ```\n *\n * Note: TypeScript config files require the Node-based `oxlint` package and Node `>=22.18`.\n *\n * @public\n */\nconst config: OxlintConfig = {\n plugins: ['typescript', 'unicorn', 'react', 'react-perf', 'oxc', 'import', 'jsx-a11y', 'promise'],\n ignorePatterns: ['**/.sanity/*', '**/dist/*', '**/sanity.types.ts'],\n options: {\n denyWarnings: true,\n reportUnusedDisableDirectives: 'error',\n typeAware: true,\n typeCheck: true,\n },\n categories: {\n correctness: 'error',\n suspicious: 'error',\n perf: 'error',\n },\n rules: {\n 'no-underscore-dangle': 'off',\n 'consistent-function-scoping': 'off',\n 'eslint/no-restricted-imports': [\n 'error',\n {\n paths: [\n {\n name: 'lodash-es',\n message:\n \"Import from individual modules instead, e.g. `import debounce from 'lodash-es/debounce.js'`. Barrel imports are ~55% slower.\",\n },\n {\n name: 'react',\n importNames: ['createElement'],\n message:\n 'Please use JSX instead of createElement, for example `createElement(Icon)` should be `<Icon />`',\n },\n {\n name: 'react',\n importNames: ['forwardRef'],\n message:\n 'forwardRef is unnecessary in React 19 — `ref` is a regular prop. Accept `ref` in your component props instead, e.g. `function Foo({ref, ...props}: Props & {ref?: Ref<T>}) {}`. See the sanity-plugin-best-practices skill.',\n },\n ],\n patterns: [\n {\n group: ['lodash.*', 'lodash/*', 'lodash'],\n message:\n \"Please use individual imports from 'lodash-es' instead, e.g. `import debounce from 'lodash-es/debounce.js'`.\",\n },\n ],\n },\n ],\n\n // React Compiler checks\n 'react/react-compiler': 'error',\n\n 'typescript/ban-ts-comment': 'error',\n 'typescript/no-deprecated': 'error',\n 'typescript/no-unnecessary-type-assertion': 'error',\n 'typescript/no-unnecessary-type-arguments': 'error',\n 'typescript/prefer-ts-expect-error': 'error',\n 'import/no-commonjs': 'error',\n 'import/no-unassigned-import': ['error', {allow: ['**/*.css']}],\n 'no-restricted-globals': [\n 'error',\n {name: '__dirname', message: 'Use path.dirname(fileURLToPath(import.meta.url)) instead'},\n {name: '__filename', message: 'Use fileURLToPath(import.meta.url) instead'},\n ],\n 'react/jsx-key': 'error',\n 'unicorn/no-abusive-eslint-disable': 'error',\n // Not relevant as we use the modern jsx-runtime transform\n 'react-in-jsx-scope': 'off',\n // Not relevant due to React Compiler\n 'react_perf/jsx-no-new-array-as-prop': 'off',\n 'react_perf/jsx-no-new-object-as-prop': 'off',\n 'react_perf/jsx-no-new-function-as-prop': 'off',\n 'react_perf/jsx-no-jsx-as-prop': 'off',\n // False negatives\n 'jsx_a11y/anchor-is-valid': 'off',\n 'jsx_a11y/no-autofocus': 'off',\n // Handy rules that are disabled by default\n 'react/exhaustive-deps': 'error',\n 'react/rules-of-hooks': 'error',\n 'eslint/no-console': ['error', {allow: ['warn', 'error']}],\n // Requires polyfills for older browsers\n 'no-array-reverse': 'off',\n 'no-array-sort': 'off',\n // Too noisy, common in callbacks/closures\n 'no-shadow': 'off',\n },\n}\n\nexport default config\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,SAAuB;CAC3B,SAAS;EAAC;EAAc;EAAW;EAAS;EAAc;EAAO;EAAU;EAAY;CAAS;CAChG,gBAAgB;EAAC;EAAgB;EAAa;CAAoB;CAClE,SAAS;EACP,cAAc;EACd,+BAA+B;EAC/B,WAAW;EACX,WAAW;CACb;CACA,YAAY;EACV,aAAa;EACb,YAAY;EACZ,MAAM;CACR;CACA,OAAO;EACL,wBAAwB;EACxB,+BAA+B;EAC/B,gCAAgC,CAC9B,SACA;GACE,OAAO;IACL;KACE,MAAM;KACN,SACE;IACJ;IACA;KACE,MAAM;KACN,aAAa,CAAC,eAAe;KAC7B,SACE;IACJ;IACA;KACE,MAAM;KACN,aAAa,CAAC,YAAY;KAC1B,SACE;IACJ;GACF;GACA,UAAU,CACR;IACE,OAAO;KAAC;KAAY;KAAY;IAAQ;IACxC,SACE;GACJ,CACF;EACF,CACF;EAGA,wBAAwB;EAExB,6BAA6B;EAC7B,4BAA4B;EAC5B,4CAA4C;EAC5C,4CAA4C;EAC5C,qCAAqC;EACrC,sBAAsB;EACtB,+BAA+B,CAAC,SAAS,EAAC,OAAO,CAAC,UAAU,EAAC,CAAC;EAC9D,yBAAyB;GACvB;GACA;IAAC,MAAM;IAAa,SAAS;GAA0D;GACvF;IAAC,MAAM;IAAc,SAAS;GAA4C;EAC5E;EACA,iBAAiB;EACjB,qCAAqC;EAErC,sBAAsB;EAEtB,uCAAuC;EACvC,wCAAwC;EACxC,0CAA0C;EAC1C,iCAAiC;EAEjC,4BAA4B;EAC5B,yBAAyB;EAEzB,yBAAyB;EACzB,wBAAwB;EACxB,qBAAqB,CAAC,SAAS,EAAC,OAAO,CAAC,QAAQ,OAAO,EAAC,CAAC;EAEzD,oBAAoB;EACpB,iBAAiB;EAEjB,aAAa;CACf;AACF"}
\ No newline at end of file