diff --git a/README.md b/README.md index 148cac8..ee42d8a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,18 @@ export default [ ] ``` +For example, for ESLint Mocha plugin: + +```js file=eslint.config.mjs +import * as hamster from '@hamster-bot/eslint-config' +import mochaPlugin from 'eslint-plugin-mocha' + +export default [ + ...hamster.configs.base, + mochaPlugin.configs.flat.recommended, +] +``` + > You can also use `require()` and `module.export` if you are using CommonJS. > In that case, you should use `.cjs` extension or just `.js` for the configuration file. diff --git a/package.json b/package.json index 60cf2ca..4256f7f 100644 --- a/package.json +++ b/package.json @@ -52,19 +52,12 @@ "@types/eslint__eslintrc": "^2.1.2", "@types/eslint__js": "^8.42.3", "eslint": "^9.12.0", - "eslint-plugin-mocha": "^10.5.0", "rollup": "^4.20.0", "tslib": "^2.7.0", "typescript": "^5.5.4" }, "peerDependencies": { - "eslint": "^8.34.0 || >=9.0.0", - "eslint-plugin-mocha": "^10.3.0" - }, - "peerDependenciesMeta": { - "eslint-plugin-mocha": { - "optional": true - } + "eslint": "^8.34.0 || >=9.0.0" }, "packageManager": "yarn@4.3.1" } diff --git a/src/base.ts b/src/base.ts index 422b0e7..18a70d4 100644 --- a/src/base.ts +++ b/src/base.ts @@ -1,7 +1,6 @@ import { FlatCompat } from '@eslint/eslintrc' import js from '@eslint/js' import { Linter } from 'eslint' -import mochaPlugin from 'eslint-plugin-mocha' import stylistic from './stylistic' @@ -10,7 +9,6 @@ const compat = new FlatCompat() const config: Linter.Config[] = [ js.configs.recommended, ...(compat.extends('plugin:import-x/recommended') as any), - mochaPlugin.configs.flat.recommended, { ignores: [ '**/.git/**', diff --git a/src/env.d.ts b/src/env.d.ts index a150e68..1f2d9d7 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -4,8 +4,8 @@ declare module 'eslint-plugin-mocha' { rules: Linter.RulesRecord configs: { flat: { - recommended: Linter.FlatConfig - all: Linter.FlatConfig + recommended: Linter.Config + all: Linter.Config } } }