Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0fccfb

Browse files
committed
update the eslint lib to v9
1 parenta68a160 commitb0fccfb

7 files changed

+569
-509
lines changed

‎.eslintrc.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎eslint.config.mjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import{FlatCompat}from'@eslint/eslintrc'
2+
importjsfrom'@eslint/js'
3+
importeslintPluginfrom'eslint-plugin-eslint-plugin'
4+
importglobalsfrom'globals'
5+
importpathfrom'node:path'
6+
import{fileURLToPath}from'node:url'
7+
8+
const__filename=fileURLToPath(import.meta.url)
9+
const__dirname=path.dirname(__filename)
10+
constcompat=newFlatCompat({
11+
baseDirectory:__dirname,
12+
recommendedConfig:js.configs.recommended,
13+
allConfig:js.configs.all,
14+
})
15+
16+
exportdefault[
17+
...compat.extends('./lib/configs/recommended.js','plugin:eslint-plugin/all'),
18+
{
19+
plugins:{
20+
'eslint-plugin':eslintPlugin,
21+
},
22+
23+
languageOptions:{
24+
globals:{
25+
...globals.node,
26+
},
27+
28+
ecmaVersion:2022,
29+
sourceType:'module',
30+
},
31+
32+
rules:{
33+
'import/extensions':'off',
34+
'import/no-commonjs':'off',
35+
'filenames/match-regex':'off',
36+
'i18n-text/no-en':'off',
37+
'eslint-plugin/prefer-placeholders':'off',
38+
'eslint-plugin/test-case-shorthand-strings':'off',
39+
'eslint-plugin/require-meta-docs-url':'off',
40+
'prettier/prettier':'off',
41+
'no-unused-vars':'off',
42+
},
43+
},
44+
]

‎lib/rules/async-currenttarget.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ module.exports = {
1212
constscopeDidWait=newWeakSet()
1313

1414
return{
15-
AwaitExpression(){
16-
scopeDidWait.add(context.getScope(),true)
15+
AwaitExpression(node){
16+
constsourceCode=context.sourceCode
17+
constscope=sourceCode.getScope(node)
18+
scopeDidWait.add(scope,true)
1719
},
1820
MemberExpression(node){
1921
if(node.property&&node.property.name==='currentTarget'){
20-
constscope=context.getScope()
22+
constsourceCode=context.sourceCode
23+
constscope=sourceCode.getScope(node)
2124
if(scope.block.async&&scopeDidWait.has(scope)){
2225
context.report({node,message:'event.currentTarget inside an async function is error prone'})
2326
}

‎lib/rules/async-preventdefault.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ module.exports = {
1212
constscopeDidWait=newWeakSet()
1313

1414
return{
15-
AwaitExpression(){
16-
scopeDidWait.add(context.getScope(),true)
15+
AwaitExpression(node){
16+
constsourceCode=context.sourceCode
17+
constscope=sourceCode.getScope(node)
18+
19+
scopeDidWait.add(scope,true)
1720
},
1821
CallExpression(node){
1922
if(node.callee.property&&node.callee.property.name==='preventDefault'){
20-
constscope=context.getScope()
23+
constsourceCode=context.sourceCode
24+
constscope=sourceCode.getScope(node)
2125
if(scope.block.async&&scopeDidWait.has(scope)){
2226
context.report({node,message:'event.preventDefault() inside an async function is error prone'})
2327
}

‎lib/rules/no-implicit-buggy-globals.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ module.exports = {
1010

1111
create(context){
1212
return{
13-
Program(){
14-
constscope=context.getScope()
13+
Program(node){
14+
constsourceCode=context.sourceCode
15+
constscope=sourceCode.getScope(node)
1516

1617
for(constvariableofscope.variables){
1718
if(variable.writeable){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp