{"name":"eslint-compat-utils","version":"0.6.4","description":"Provides an API for ESLint custom rules that is compatible with the latest ESLint even when using older ESLint.","engines":{"node":">=12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./eslint":{"types":"./dist/eslint.d.ts","import":"./dist/eslint.mjs","require":"./dist/eslint.cjs"},"./linter":{"types":"./dist/linter.d.ts","import":"./dist/linter.mjs","require":"./dist/linter.cjs"},"./rule-tester":{"types":"./dist/rule-tester.d.ts","import":"./dist/rule-tester.mjs","require":"./dist/rule-tester.cjs"},"./package.json":"./package.json"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"prebuild":"npm run -s clean","build":"unbuild","clean":"rimraf .nyc_output dist coverage","lint":"npm-run-all \"lint:*\"","lint:js":"eslint .","eslint-fix":"eslint . --fix","test:cover":"nyc --reporter=lcov npm run test","test":"npm run mocha -- \"tests/src/**/*.ts\" --reporter dot --timeout 60000","update:extract-v6-props":"npm run ts -- tools/extract-v6-props.ts","ts":"node -r esbuild-register","mocha":"npm run ts -- ./node_modules/mocha/bin/mocha.js","prerelease":"npm run clean && npm run build","release":"changeset publish"},"repository":{"type":"git","url":"git+https://github.com/ota-meshi/eslint-compat-utils.git"},"keywords":["eslint"],"author":{"name":"Yosuke Ota","url":"https://github.com/ota-meshi"},"license":"MIT","bugs":{"url":"https://github.com/ota-meshi/eslint-compat-utils/issues"},"homepage":"https://github.com/ota-meshi/eslint-compat-utils#readme","peerDependencies":{"eslint":">=6.0.0"},"publishConfig":{"access":"public"},"devDependencies":{"@changesets/cli":"^2.26.2","@ota-meshi/eslint-plugin":"^0.17.5","@svitejs/changesets-changelog-github-compact":"^1.1.0","@types/eslint":"^9.0.0","@types/mocha":"^10.0.0","@types/node":"^22.0.0","@types/semver":"^7.5.8","esbuild-register":"^3.5.0","eslint":"^9.14.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jsdoc":"^50.4.3","eslint-plugin-json-schema-validator":"^5.0.0","eslint-plugin-jsonc":"^2.9.0","eslint-plugin-n":"^17.0.0","eslint-plugin-node-dependencies":"^0.12.0","eslint-plugin-prettier":"^5.0.0","eslint-plugin-yml":"^1.9.0","mocha":"^10.2.0","npm-run-all2":"^7.0.0","nyc":"^17.0.0","prettier":"^3.0.3","typescript-eslint":"^8.13.0","unbuild":"^2.0.0"},"dependencies":{"semver":"^7.5.4"},"_id":"eslint-compat-utils@0.6.4","gitHead":"4b9dac3459d1e4e1a6942f35e0e4b37dc831022c","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-/u+GQt8NMfXO8w17QendT4gvO5acfxQsAKirAt0LVxDnr2N8YLCVbregaNc/Yhp7NM128DwCaRvr8PLDfeNkQw==","shasum":"173d305132da755ac3612cccab03e1b2e14235ed","tarball":"http://registry-npm.ywwl.com/eslint-compat-utils/download/eslint-compat-utils-0.6.4.tgz","fileCount":29,"unpackedSize":54119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB69UI7j7FraAO/w9ZSIRttcKjhRfslVBHVak8r80incAiEAn6KrZKPyZzlMsjPhQuvHBuvhee36FUtvEGUzDbCCxKA="}],"size":12794,"noattachment":false,"key":"/eslint-compat-utils/-/eslint-compat-utils-0.6.4.tgz"},"_npmUser":{"name":"ota-meshi","email":"otameshiyo23@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-compat-utils_0.6.4_1732767893544_0.3265675185197383"},"_hasShrinkwrap":false,"readme":"# eslint-compat-utils\n\n***This package is still in the experimental stage.***\n\nProvides an API for ESLint custom rules that is compatible with the latest ESLint even when using older ESLint.\n\n## Installation\n\n```bash\nnpm install eslint-compat-utils\n```\n\n## Usage\n\n```js\nconst { getSourceCode } = require(\"eslint-compat-utils\");\nmodule.exports = {\n  meta: { /* ... */ },\n  create(context) {\n    const sourceCode = getSourceCode(context)\n    return {\n      \"Program\"(node) {\n        const scope = sourceCode.getScope(node);\n      },\n    };\n  },\n}\n```\n\n### API\n\n#### `getSourceCode(context)`\n\nReturns an extended instance of `context.sourceCode` or the result of `context.getSourceCode()`. Extended instances can use new APIs such as `getScope(node)` even with old ESLint.\n\n#### `getCwd(context)`\n\nGets the value of `context.cwd`, but for older ESLint it returns the result of `context.getCwd()`.\nVersions older than v6.6.0 return a value from the result of `process.cwd()`.\n\n#### `getFilename(context)`\n\nGets the value of `context.filename`, but for older ESLint it returns the result of `context.getFilename()`.\n\n#### `getPhysicalFilename(context)`\n\nGets the value of `context.physicalFilename`, but for older ESLint it returns the result of `context.getPhysicalFilename()`.\nVersions older than v7.28.0 return a value guessed from the result of `context.getFilename()`, but it may be incorrect.\n","publish_time":1732767893735,"maintainers":[{"name":"ota-meshi","email":"otameshiyo23@gmail.com"}],"_cnpm_publish_time":1732767893735,"dist-tags":{"latest":"0.6.5"}}