Skip to content

Commit

Permalink
dev: updates devDependencies, migrates to eslint.config.js, upgrades …
Browse files Browse the repository at this point in the history
…GH actions
webketje committed Nov 1, 2024
1 parent ed6ecf8 commit fca217f
Showing 7 changed files with 4,232 additions and 6,205 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.yml

This file was deleted.

59 changes: 59 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import js from '@eslint/js'
import globals from 'globals'
import prettier from 'eslint-config-prettier'
import pluginImport from 'eslint-plugin-import'
import pluginNode from 'eslint-plugin-n'

const config = [
{
ignores: ['lib'],
languageOptions: {
globals: {
...globals.node
},

ecmaVersion: 2020,
sourceType: 'module'
},

rules: {
...js.configs.recommended.rules,
'no-console': 'error',
'prefer-const': 'error',
'no-var': 'error',
'no-use-before-define': 'error',
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'no-await-in-loop': 'error',
'n/exports-style': [0, 'error'],
'import/first': 'error',
'import/no-anonymous-default-export': 'error',
'import/no-unassigned-import': 'error',
'import/no-internal-modules': [
'error',
{
allow: ['src/**']
}
]
},
plugins: {
import: pluginImport,
n: pluginNode,
prettier: prettier
}
},
{
files: ['test/{**/,}*.js'],
languageOptions: {
globals: { ...globals.mocha }
}
}
]

export default config
10,329 changes: 4,162 additions & 6,167 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -60,17 +60,17 @@
},
"devDependencies": {
"assert-dir-equal": "github:webketje/assert-dir-equal#v2.0.0",
"auto-changelog": "^2.4.0",
"c8": "^8.0.1",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.0.1",
"metalsmith": "^2.6.1",
"auto-changelog": "^2.5.0",
"c8": "^10.1.2",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.12.0",
"metalsmith": "^2.6.3",
"microbundle": "^0.15.1",
"mocha": "^10.2.0",
"prettier": "^3.0.2",
"release-it": "^16.1.5"
"mocha": "^10.8.2",
"prettier": "^3.3.3",
"release-it": "^17.10.0"
},
"peerDependencies": {
"metalsmith": "^2.5.0"
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ function drafts(options = defaultOptions) {
debug.info('Removed draft "%s"', path)
// but throws in CJS strict-mode or ESM mode
/* c8 ignore start */
} catch (err) {
} catch (_err) {
debug.error('Failed to remove draft at "%s"', path)
}
/* c8 ignore end */
2 changes: 0 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-env node, mocha */

import equal from 'assert-dir-equal'
import Metalsmith from 'metalsmith'
import drafts from '../src/index.js'

0 comments on commit fca217f

Please sign in to comment.