Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: drop ESLint v3, v4, v5, v6 & v7 support #3846

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 2022,
"ecmaFeatures": {
"jsx": true
},
Expand All @@ -34,17 +34,10 @@
"consistent-return": 0,

"prefer-destructuring": [2, { "array": false, "object": false }, { "enforceForRenamedProperties": false }],
"prefer-object-spread": 0, // until node 8 is required
"prefer-rest-params": 0, // until node 6 is required
"prefer-spread": 0, // until node 6 is required
"function-call-argument-newline": 1, // TODO: enable
"function-call-argument-newline": 1,
"function-paren-newline": 0,
"no-plusplus": [2, {"allowForLoopAfterthoughts": true}],
"no-param-reassign": 1,
"no-restricted-syntax": [2, {
"selector": "ObjectPattern",
"message": "Object destructuring is not compatible with Node v4"
}],
"strict": [2, "safe"],
"valid-jsdoc": [2, {
"requireReturn": false,
Expand Down Expand Up @@ -73,12 +66,11 @@
{
"files": ".github/workflows/*.js",
"parserOptions": {
"ecmaVersion": 2019,
"ecmaVersion": 2022,
},
"rules": {
"camelcase": 0,
"no-console": 0,
"no-restricted-syntax": 0,
},
},
],
Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/node-minors.yml

This file was deleted.

56 changes: 4 additions & 52 deletions .github/workflows/node-18+.yml → .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Tests: node.js (18+)'
name: 'Tests: node.js'

on: [pull_request, push]

Expand All @@ -14,7 +14,7 @@ jobs:
with:
versionsAsRoot: true
type: majors
preset: '>=18'
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'

latest:
needs: [matrix]
Expand All @@ -27,13 +27,9 @@ jobs:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 9
- 9.0.0
- 8
- 7
- 6
- 5
- 4
- 4.14 # last version without messageId
- 3
- 8.57.0
babel-eslint:
- 10
- 9
Expand All @@ -44,54 +40,10 @@ jobs:
- 7
- 8
exclude:
- eslint: 3
babel-eslint: 10
- eslint: 3
typescript-eslint: 5
- eslint: 4
typescript-eslint: 5
- eslint: 4.14
typescript-eslint: 5
- eslint: 5
typescript-eslint: 5
- eslint: 3
typescript-eslint: 6
- eslint: 4
typescript-eslint: 6
- eslint: 4.14
typescript-eslint: 6
- eslint: 5
typescript-eslint: 6
- eslint: 6
typescript-eslint: 6
- eslint: 9
typescript-eslint: 6
- eslint: 3
typescript-eslint: 7
- eslint: 4
typescript-eslint: 7
- eslint: 4.14
typescript-eslint: 7
- eslint: 5
typescript-eslint: 7
- eslint: 6
typescript-eslint: 7
- eslint: 7
typescript-eslint: 7
- eslint: 9
typescript-eslint: 7
- eslint: 3
typescript-eslint: 8
- eslint: 4
typescript-eslint: 8
- eslint: 4.14
typescript-eslint: 8
- eslint: 5
typescript-eslint: 8
- eslint: 6
typescript-eslint: 8
- eslint: 7
typescript-eslint: 8
- eslint: 9
typescript-eslint: 5
- node-version: 19
Expand Down
12 changes: 6 additions & 6 deletions lib/rules/boolean-prop-naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ module.exports = {
}

const annotationTypeArguments = propsUtil.getTypeArguments(
component.node.parent.id.typeAnnotation.typeAnnotation
component.node.parent.id.typeAnnotation.typeAnnotation,
);
if (
annotationTypeArguments && (
Expand All @@ -269,7 +269,7 @@ module.exports = {
)
) {
return annotationTypeArguments.params.find(
(param) => param.type === 'TSTypeReference' || param.type === 'GenericTypeAnnotation'
(param) => param.type === 'TSTypeReference' || param.type === 'GenericTypeAnnotation',
);
}
}
Expand All @@ -278,7 +278,7 @@ module.exports = {
if (node.type === 'TSTypeLiteral' || node.type === 'ObjectTypeAnnotation' || node.type === 'TSInterfaceBody') {
const currentNode = [].concat(
objectTypeAnnotations.get(identifier.name) || [],
node
node,
);
objectTypeAnnotations.set(identifier.name, currentNode);
} else if (
Expand Down Expand Up @@ -317,7 +317,7 @@ module.exports = {
&& astUtil.isCallExpression(node.value)
&& propWrapperUtil.isPropWrapperFunction(
context,
getText(context, node.value.callee)
getText(context, node.value.callee),
)
) {
checkPropWrapperArguments(node, node.value.arguments);
Expand All @@ -343,7 +343,7 @@ module.exports = {
astUtil.isCallExpression(right)
&& propWrapperUtil.isPropWrapperFunction(
context,
getText(context, right.callee)
getText(context, right.callee),
)
) {
checkPropWrapperArguments(component.node, right.arguments);
Expand Down Expand Up @@ -407,7 +407,7 @@ module.exports = {
[].concat(propType).filter(Boolean).forEach((prop) => {
validatePropNaming(
component.node,
prop.properties || prop.members || prop.body
prop.properties || prop.members || prop.body,
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/button-has-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = {
},

create(context) {
const configuration = Object.assign({}, optionDefaults, context.options[0]);
const configuration = { ...optionDefaults, ...context.options[0] };

function reportMissing(node) {
report(context, messages.missingType, 'missingType', {
Expand Down
10 changes: 5 additions & 5 deletions lib/rules/checked-requires-onchange-or-readonly.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function extractTargetProps(properties, keyName) {
prop[keyName] && targetPropSet.has(prop[keyName].name)
? [prop[keyName].name]
: []
)
)
),
),
);
}

Expand All @@ -64,14 +64,14 @@ module.exports = {
}],
},
create(context) {
const options = Object.assign({}, defaultOptions, context.options[0]);
const options = { ...defaultOptions, ...context.options[0] };

function reportMissingProperty(node) {
report(
context,
messages.missingProperty,
'missingProperty',
{ node }
{ node },
);
}

Expand All @@ -80,7 +80,7 @@ module.exports = {
context,
messages.exclusiveCheckedAttribute,
'exclusiveCheckedAttribute',
{ node }
{ node },
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/default-props-match-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module.exports = {
.forEach((component) => {
reportInvalidDefaultProps(
component.declaredPropTypes,
component.defaultProps || {}
component.defaultProps || {},
);
});
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/display-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ module.exports = {
// Report missing display name for all context objects
forEach(
filter(contextObjects.values(), (v) => !v.hasDisplayName),
(contextObj) => reportMissingContextDisplayName(contextObj)
(contextObj) => reportMissingContextDisplayName(contextObj),
);
}
},
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/forbid-component-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ module.exports = {
}

return options.allowPatternList.every(
(pattern) => !minimatch(tagName, pattern)
(pattern) => !minimatch(tagName, pattern),
);
}

Expand All @@ -193,7 +193,7 @@ module.exports = {
}

return options.disallowPatternList.some(
(pattern) => minimatch(tagName, pattern)
(pattern) => minimatch(tagName, pattern),
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/forbid-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = {
element,
message,
},
}
},
);
}
}
Expand Down
Loading
Loading