Skip to content

Commit

Permalink
Update ESLint and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jun 8, 2024
1 parent 4424c96 commit a36e1ad
Show file tree
Hide file tree
Showing 16 changed files with 958 additions and 844 deletions.
67 changes: 67 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { FlatCompat } from '@eslint/eslintrc'
import loguxConfig from '@logux/eslint-config'
import es5Plugin from 'eslint-plugin-es5'

let compat = new FlatCompat({
baseDirectory: import.meta.dirname
})

let es5 = compat.extends('plugin:es5/no-es2015')

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
{ ignores: ['coverage'] },
...loguxConfig,
...es5,
{
plugins: {
es5: es5Plugin
},
rules: {
'node-import/prefer-node-protocol': 'off',
'perfectionist/sort-objects': 'off',
'n/prefer-node-protocol': 'off',
'prefer-let/prefer-let': 'off',
'prefer-arrow-callback': 'off',
'no-unused-vars': ['error', { caughtErrors: 'none' }],
'n/global-require': 'off',
'object-shorthand': 'off',
'no-console': 'off',
'no-var': 'off'
}
},
{
files: ['cli.js'],
rules: {
'n/no-unsupported-features/es-syntax': [
'error',
{
version: '>=12.5.0',
ignores: []
}
]
}
},
{
files: ['test/**/*', 'eslint.config.mjs'],
rules: {
'n/no-unsupported-features/es-syntax': 'off',
'es5/no-shorthand-properties': 'off',
'es5/no-template-literals': 'off',
'es5/no-rest-parameters': 'off',
'es5/no-arrow-functions': 'off',
'es5/no-destructuring': 'off',
'es5/no-block-scoping': 'off',
'es5/no-es6-methods': 'off',
'es5/no-spread': 'off',
'es5/no-for-of': 'off',
'no-console': 'off'
}
},
{
files: ['eslint.config.mjs'],
rules: {
'es5/no-modules': 'off'
}
}
]
9 changes: 4 additions & 5 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function eachParent(file, callback) {
var dir = isFile(file) ? path.dirname(file) : file
var loc = path.resolve(dir)
do {
if (!pathInRoot(loc)) break;
if (!pathInRoot(loc)) break
var result = callback(loc)
if (typeof result !== 'undefined') return result
} while (loc !== (loc = path.dirname(loc)))
Expand All @@ -59,9 +59,9 @@ function eachParent(file, callback) {

function pathInRoot(p) {
if (!process.env.BROWSERSLIST_ROOT_PATH) return true
var rootPath = path.resolve(process.env.BROWSERSLIST_ROOT_PATH);
if (path.relative(rootPath, p).substring(0,2) === '..') {
return false;
var rootPath = path.resolve(process.env.BROWSERSLIST_ROOT_PATH)
if (path.relative(rootPath, p).substring(0, 2) === '..') {
return false
}
return true
}
Expand Down Expand Up @@ -167,7 +167,6 @@ function normalizeStats(data, stats) {
function normalizeUsageData(usageData, data) {
for (var browser in usageData) {
var browserUsage = usageData[browser]
// eslint-disable-next-line max-len
// https://github.com/browserslist/browserslist/issues/431#issuecomment-565230615
// caniuse-db returns { 0: "percentage" } for `and_*` regional stats
if ('0' in browserUsage) {
Expand Down
22 changes: 8 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"test": "pnpm run /^test:/"
},
"dependencies": {
"caniuse-lite": "^1.0.30001587",
"electron-to-chromium": "^1.4.668",
"caniuse-lite": "^1.0.30001629",
"electron-to-chromium": "^1.4.796",
"node-releases": "^2.0.14",
"update-browserslist-db": "^1.0.13"
"update-browserslist-db": "^1.0.16"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
Expand All @@ -45,22 +45,16 @@
},
"types": "./index.d.ts",
"devDependencies": {
"@logux/eslint-config": "^52.0.2",
"@size-limit/preset-small-lib": "^11.0.2",
"@logux/eslint-config": "^53.2.0",
"@size-limit/preset-small-lib": "^11.1.4",
"c8": "^9.1.0",
"clean-publish": "^4.2.0",
"clean-publish": "^5.0.0",
"cross-spawn": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-standard": "^17.1.0",
"eslint": "^9.4.0",
"eslint-plugin-es5": "^1.5.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-perfectionist": "^2.5.0",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.1.1",
"fs-extra": "^11.2.0",
"nanospy": "^1.0.0",
"size-limit": "^11.0.2",
"size-limit": "^11.1.4",
"uvu": "^0.5.6"
},
"browser": {
Expand Down
Loading

0 comments on commit a36e1ad

Please sign in to comment.