Skip to content

Commit

Permalink
feat(eslint): disable Opinionated
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse484 committed Jun 23, 2024
1 parent b97a7a4 commit 7dda835
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions packages/eslint/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,26 @@ import antfu, {
* The merged ESLint configurations.
*/
export async function mouse(options, ...userConfigs) {
options = {
lessOpinionated: true,
...options,
}

/** @type {TypedFlatConfigItem[]} */
const configs = []

configs.push({
name: 'mouse/source-files',
files: [GLOB_SRC],
rules: {
'style/max-len': ['error', {
code: 80,
tabWidth: 2,
comments: 120,
}],
'style/max-len': [
'error',
{
code: 80,
tabWidth: 2,
comments: 120,
},
],
},
})

Expand All @@ -52,14 +60,14 @@ export async function mouse(options, ...userConfigs) {
*/
const getRules = (key) => {
const typescriptOptions = resolveSubOptions(options, 'typescript')
const tsconfigPath = 'tsconfigPath' in typescriptOptions
? typescriptOptions.tsconfigPath
: undefined
const tsconfigPath
= 'tsconfigPath' in typescriptOptions
? typescriptOptions.tsconfigPath
: undefined

return renameRules(
pluginTs.configs[
tsconfigPath ? `${key}-type-checked` : key
]?.rules ?? {},
pluginTs.configs[tsconfigPath ? `${key}-type-checked` : key]?.rules
?? {},
{ '@typescript-eslint': 'ts' },
)
}
Expand Down

0 comments on commit 7dda835

Please sign in to comment.