Skip to content

Commit

Permalink
fix: remove mocha plugin as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Nov 8, 2024
1 parent b25872a commit 3a1e434
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]"
}
2 changes: 0 additions & 2 deletions src/base.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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/**',
Expand Down
4 changes: 2 additions & 2 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 3a1e434

Please sign in to comment.