Skip to content

Commit

Permalink
Update eslint to v9 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
asamuzaK authored Sep 28, 2024
1 parent 15e6c55 commit ca40ac6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 59 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc

This file was deleted.

70 changes: 70 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import babelParser from '@babel/eslint-parser';
import importX from 'eslint-plugin-import-x';
import jsdoc from 'eslint-plugin-jsdoc';
import regexp from 'eslint-plugin-regexp';
import unicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import neostandard, { plugins as neostdplugins } from 'neostandard';

export default [
{
ignores: ['dist/', 'test/file/', 'test/wpt/', 'benchmark/']
},
jsdoc.configs['flat/recommended'],
regexp.configs['flat/recommended'],
...neostandard({
semi: true
}),
{
plugins: {
'@stylistic': neostdplugins['@stylistic'],
'import-x': importX,
regexp,
unicorn
},
linterOptions: {
reportUnusedDisableDirectives: true
},
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.node,
...globals.webextensions
},
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
babelrc: false,
configFile: false,
plugins: [
'@babel/plugin-syntax-import-assertions'
]
}
},
sourceType: 'module'
},
rules: {
'@stylistic/space-before-function-paren': ['error', {
anonymous: 'always',
asyncArrow: 'always',
named: 'never'
}],
'import-x/order': ['error', {
alphabetize: {
order: 'ignore',
caseInsensitive: false
}
}],
'no-await-in-loop': 'error',
'no-use-before-define': ['error', {
allowNamedExports: false,
classes: true,
functions: true,
variables: true
}],
'unicorn/prefer-node-protocol': 'error'
}
}
];
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"jsdom": "^25.0.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-syntax-import-assertions": "^7.25.6",
"@types/dompurify": "^3.0.5",
Expand All @@ -36,14 +37,15 @@
"copyfiles": "^2.4.1",
"csvtojson": "^2.0.10",
"esbuild": "^0.24.0",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.30.0",
"eslint": "^9.11.1",
"eslint-plugin-import-x": "^4.3.0",
"eslint-plugin-jsdoc": "^50.3.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-unicorn": "^55.0.0",
"globals": "^15.9.0",
"http-server": "^14.1.1",
"mocha": "^10.7.3",
"neostandard": "^0.11.6",
"npm-run-all": "^4.1.5",
"sinon": "^19.0.2",
"typescript": "^5.6.2",
Expand Down
4 changes: 2 additions & 2 deletions src/mjs/sanitizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class URLSanitizer extends URISchemes {
purifiedDom = purifiedDom.replace(/(?:#|%23)$/, '')
.replace(/(?<!(?:#|%23).*)(?:\?|%3F)$/, '');
return encodeURI(purifiedDom);
};
}

/**
* sanitize URL
Expand Down Expand Up @@ -363,7 +363,7 @@ export class URLSanitizer extends URISchemes {
this.#nest = 0;
this.#recurse.clear();
}
};
}

/* aliases and async wrappers */
/* instance */
Expand Down
2 changes: 1 addition & 1 deletion src/mjs/uri-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ export class URISchemes {
this.#schemes.add(scheme);
}
}
};
}

0 comments on commit ca40ac6

Please sign in to comment.