{"name":"eslint-compat-utils","version":"0.6.5","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":"^10.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":"^3.0.0"},"dependencies":{"semver":"^7.5.4"},"_id":"eslint-compat-utils@0.6.5","gitHead":"97e612756924c106fe36f6d4815c79651c2e2fb0","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-vAUHYzue4YAa2hNACjB8HvUQj5yehAZgiClyFVVom9cP8z5NSFq3PwB/TtJslN2zAMgRX6FCFCjYBbQh71g5RQ==","shasum":"6b06350a1c947c4514cfa64a170a6bfdbadc7ec2","tarball":"http://registry-npm.ywwl.com/eslint-compat-utils/download/eslint-compat-utils-0.6.5.tgz","fileCount":29,"unpackedSize":55193,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCHyL0r+bxzmrJpsFSF7OA0jnYDKgA/lTDBNTs4OSz2zQCIQCyKRCicz1ar/wAbvebk/vLFeNXnvpUl77yCi3pySDaGg=="}],"size":13110,"noattachment":false,"key":"/eslint-compat-utils/-/eslint-compat-utils-0.6.5.tgz"},"_npmUser":{"name":"ota-meshi","email":"otameshiyo23@gmail.com"},"directories":{},"maintainers":[{"name":"ota-meshi","email":"otameshiyo23@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-compat-utils_0.6.5_1743633729501_0.6010477772062162"},"_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":1743633729740,"_cnpm_publish_time":1743633729740,"dist-tags":{"latest":"0.6.5"}}