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 4, 2025
1 parent 5186056 commit a285d59
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 67 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ dist/
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.yalc/
yalc.lock
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'] }
36 changes: 25 additions & 11 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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
Expand All @@ -14,31 +15,44 @@ const compat = new FlatCompat({


export default [
...compat.config({
{
ignores: [
'.yarn/',
'.yalc/',
'dist/',
],
},

...fixupConfigRules(compat.config({
extends: [
'@jenssimon/eslint-config-base',
],
overrides: [
{
files: [
'commitlint.config.js',
parserOptions: {
project: './tsconfig.json',
},
extends: [
'@jenssimon/eslint-config-typescript',
],
files: ['*.ts'],
rules: {
'unicorn/prefer-module': 'off',
'@typescript-eslint/naming-convention': 'off',
},
},
],
}),
})).map((rule) => ({
files: [
'**/*.js',
'**/*.mjs',
'**/*.ts',
],
...rule,
})),
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
},
{
ignores: [
'.yarn/',
'dist/',
],
},
]
26 changes: 3 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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",
"@jenssimon/eslint-config-typescript": "^5.2.2",
"@types/eslint": "^9.0.0",
Expand All @@ -45,30 +47,8 @@
"peerDependencies": {
"eslint": ">=1.0.0"
},
"eslintConfig": {
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"@jenssimon/base",
"@jenssimon/typescript"
],
"rules": {
"@typescript-eslint/naming-convention": "off"
},
"overrides": [
{
"files": [
"commitlint.config.js"
],
"rules": {
"unicorn/prefer-module": "off"
}
}
]
},
"scripts": {
"lint": "eslint",
"lint": "eslint ./",
"build": "tsc",
"prepublishOnly": "tsc",
"commit": "cz",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
},
"include": [
"src/**/*.ts",
"commitlint.config.js"
"commitlint.config.mjs",
"eslint.config.mjs"
],
"exclude": [
"node_modules",
Expand Down
98 changes: 68 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,18 @@ __metadata:
languageName: node
linkType: hard

"@eslint/compat@npm:^1.2.4":
version: 1.2.4
resolution: "@eslint/compat@npm:1.2.4"
peerDependencies:
eslint: ^9.10.0
peerDependenciesMeta:
eslint:
optional: true
checksum: 10c0/afea54435f0ae6b05f1b732132ae4a9d95ff106be0fc9988ac19f31037eb89b2a0e968212be4d2fbf757ff16923031825a27739d94a365559089dfd8269331e3
languageName: node
linkType: hard

"@eslint/eslintrc@npm:^2.1.4":
version: 2.1.4
resolution: "@eslint/eslintrc@npm:2.1.4"
Expand All @@ -1680,6 +1692,23 @@ __metadata:
languageName: node
linkType: hard

"@eslint/eslintrc@npm:^3.2.0":
version: 3.2.0
resolution: "@eslint/eslintrc@npm:3.2.0"
dependencies:
ajv: "npm:^6.12.4"
debug: "npm:^4.3.2"
espree: "npm:^10.0.1"
globals: "npm:^14.0.0"
ignore: "npm:^5.2.0"
import-fresh: "npm:^3.2.1"
js-yaml: "npm:^4.1.0"
minimatch: "npm:^3.1.2"
strip-json-comments: "npm:^3.1.1"
checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b
languageName: node
linkType: hard

"@eslint/js@npm:8.57.1":
version: 8.57.1
resolution: "@eslint/js@npm:8.57.1"
Expand Down Expand Up @@ -2843,6 +2872,15 @@ __metadata:
languageName: node
linkType: hard

"acorn@npm:^8.14.0":
version: 8.14.0
resolution: "acorn@npm:8.14.0"
bin:
acorn: bin/acorn
checksum: 10c0/6d4ee461a7734b2f48836ee0fbb752903606e576cc100eb49340295129ca0b452f3ba91ddd4424a1d4406a98adfb2ebb6bd0ff4c49d7a0930c10e462719bbfd7
languageName: node
linkType: hard

"acorn@npm:^8.4.1":
version: 8.8.0
resolution: "acorn@npm:8.8.0"
Expand Down Expand Up @@ -4450,6 +4488,8 @@ __metadata:
dependencies:
"@commitlint/cli": "npm:^19.0.0"
"@commitlint/config-conventional": "npm:^19.0.0"
"@eslint/compat": "npm:^1.2.4"
"@eslint/eslintrc": "npm:^3.2.0"
"@jenssimon/eslint-config-base": "npm:^8.0.0"
"@jenssimon/eslint-config-typescript": "npm:^5.2.2"
"@types/eslint": "npm:^9.0.0"
Expand Down Expand Up @@ -4621,14 +4661,7 @@ __metadata:
languageName: node
linkType: hard

"eslint-visitor-keys@npm:^3.4.1":
version: 3.4.1
resolution: "eslint-visitor-keys@npm:3.4.1"
checksum: 10c0/b4ebd35aed5426cd81b1fb92487825f1acf47a31e91d76597a3ee0664d69627140c4dafaf9b319cfeb1f48c1113a393e21a734c669e6565a72e6fcc311bd9911
languageName: node
linkType: hard

"eslint-visitor-keys@npm:^3.4.3":
"eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3":
version: 3.4.3
resolution: "eslint-visitor-keys@npm:3.4.3"
checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820
Expand All @@ -4642,6 +4675,13 @@ __metadata:
languageName: node
linkType: hard

"eslint-visitor-keys@npm:^4.2.0":
version: 4.2.0
resolution: "eslint-visitor-keys@npm:4.2.0"
checksum: 10c0/2ed81c663b147ca6f578312919483eb040295bbab759e5a371953456c636c5b49a559883e2677112453728d66293c0a4c90ab11cab3428cf02a0236d2e738269
languageName: node
linkType: hard

"eslint@npm:^8.52.0":
version: 8.57.1
resolution: "eslint@npm:8.57.1"
Expand Down Expand Up @@ -4690,6 +4730,17 @@ __metadata:
languageName: node
linkType: hard

"espree@npm:^10.0.1":
version: 10.3.0
resolution: "espree@npm:10.3.0"
dependencies:
acorn: "npm:^8.14.0"
acorn-jsx: "npm:^5.3.2"
eslint-visitor-keys: "npm:^4.2.0"
checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462
languageName: node
linkType: hard

"espree@npm:^10.2.0":
version: 10.2.0
resolution: "espree@npm:10.2.0"
Expand All @@ -4701,18 +4752,7 @@ __metadata:
languageName: node
linkType: hard

"espree@npm:^9.6.0":
version: 9.6.0
resolution: "espree@npm:9.6.0"
dependencies:
acorn: "npm:^8.9.0"
acorn-jsx: "npm:^5.3.2"
eslint-visitor-keys: "npm:^3.4.1"
checksum: 10c0/f064a43bcf7f435d34e600c056320dde1c15b3eeb5da24e7585ed6cf83adcbbeafb4fa4d062ff14281b0d246b0a9645dd9d3796a638099f19595004eee4ac8be
languageName: node
linkType: hard

"espree@npm:^9.6.1":
"espree@npm:^9.6.0, espree@npm:^9.6.1":
version: 9.6.1
resolution: "espree@npm:9.6.1"
dependencies:
Expand All @@ -4723,16 +4763,7 @@ __metadata:
languageName: node
linkType: hard

"esquery@npm:^1.4.2":
version: 1.4.2
resolution: "esquery@npm:1.4.2"
dependencies:
estraverse: "npm:^5.1.0"
checksum: 10c0/b4109b3d8301e79bf0be10bbafe4ac9c5469274e61b07a16e7174e99efe815081bc18ac2e6d951d06df95004ac5772751db5d5b14483e51aefa96b018726117d
languageName: node
linkType: hard

"esquery@npm:^1.6.0":
"esquery@npm:^1.4.2, esquery@npm:^1.6.0":
version: 1.6.0
resolution: "esquery@npm:1.6.0"
dependencies:
Expand Down Expand Up @@ -5463,6 +5494,13 @@ __metadata:
languageName: node
linkType: hard

"globals@npm:^14.0.0":
version: 14.0.0
resolution: "globals@npm:14.0.0"
checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d
languageName: node
linkType: hard

"globals@npm:^15.9.0":
version: 15.11.0
resolution: "globals@npm:15.11.0"
Expand Down

0 comments on commit a285d59

Please sign in to comment.