Skip to content

Commit

Permalink
Update ESLint to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Apr 29, 2024
1 parent 3873659 commit 2b56d5c
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 61 deletions.
2 changes: 1 addition & 1 deletion check-npm-version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let { execSync } = require('child_process')
let { execSync } = require('node:child_process')
let pico = require('picocolors')

try {
Expand Down
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

let { readFileSync } = require('fs')
let { join } = require('path')
let { readFileSync } = require('node:fs')
let { join } = require('node:path')

require('./check-npm-version')
let updateDb = require('./')
Expand Down
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import loguxConfig from '@logux/eslint-config'

export default [
...loguxConfig,
{
rules: {
'n/global-require': 'off',
'node-import/prefer-node-protocol': 'off'
}
},
{
files: ['*/*.test.js'],
rules: {
'no-control-regex': 'off'
}
}
]
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let { existsSync, readFileSync, writeFileSync } = require('fs')
let { execSync } = require('child_process')
let { join } = require('path')
let { existsSync, readFileSync, writeFileSync } = require('node:fs')
let { execSync } = require('node:child_process')
let { join } = require('node:path')
let escalade = require('escalade/sync')
let pico = require('picocolors')

Expand Down
18 changes: 1 addition & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"bin": "cli.js",
"devDependencies": {
"@logux/eslint-config": "^52.0.2",
"@logux/eslint-config": "^53.0.1",
"browserslist": "^4.23.0",
"c8": "^9.1.0",
"clean-publish": "^4.4.0",
Expand Down Expand Up @@ -78,22 +78,6 @@
"limit": "16 KB"
}
],
"eslintConfig": {
"extends": "@logux/eslint-config",
"rules": {
"node-import/prefer-node-protocol": "off",
"consistent-return": "off",
"n/global-require": "off"
},
"overrides": [
{
"files": "*.test.js",
"rules": {
"no-control-regex": "off"
}
}
]
},
"prettier": {
"arrowParens": "avoid",
"jsxSingleQuote": false,
Expand Down
Loading

0 comments on commit 2b56d5c

Please sign in to comment.