Skip to content

Commit

Permalink
chore(deps): use flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
jenssimon committed Jan 5, 2025
1 parent 9ba1900 commit 10d99ad
Show file tree
Hide file tree
Showing 5 changed files with 2,039 additions and 2,049 deletions.
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] }
45 changes: 45 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'

import { FlatCompat } from '@eslint/eslintrc'
import { fixupConfigRules } from '@eslint/compat'


// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url) // eslint-disable-line no-underscore-dangle
const __dirname = path.dirname(__filename) // eslint-disable-line no-underscore-dangle

const compat = new FlatCompat({
baseDirectory: __dirname,
})


export default [
{
ignores: [
'.yarn/',
'.yalc/',
],
},

...fixupConfigRules(compat.config({
extends: [
'@jenssimon/base',
],
})).map((rule) => ({
files: [
'**/*.js',
'**/*.mjs',
],
...rule,
})),

{
files: [
'**/*.js',
],
rules: {
'unicorn/prefer-module': 'off',
},
},
]
14 changes: 4 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"/index.js"
],
"scripts": {
"lint": "eslint --ext .js,.ts,.cjs,.mjs,.cts,.mts ./",
"lint": "eslint ./",
"commit": "cz",
"postinstall": "husky",
"prepack": "pinst --disable",
Expand All @@ -34,6 +34,8 @@
"devDependencies": {
"@commitlint/cli": "^19.0.0",
"@commitlint/config-conventional": "^19.0.0",
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@jenssimon/eslint-config-base": "^8.0.0",
"@types/node": "^22.0.0",
"commitizen": "^4.3.0",
Expand All @@ -51,16 +53,8 @@
"eslint": "^7.0.0 || ^8.0.0",
"typescript": ">=4.0.0"
},
"eslintConfig": {
"extends": [
"@jenssimon/base"
],
"rules": {
"unicorn/prefer-module": "off"
}
},
"lint-staged": {
"**/*.{js,ts}": "eslint"
"**/*.{js,mjs}": "eslint"
},
"packageManager": "[email protected]",
"config": {
Expand Down
Loading

0 comments on commit 10d99ad

Please sign in to comment.