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

Update typescript-eslint monorepo to v8 (master) (major) #9434

Merged
merged 3 commits into from
Aug 26, 2024
Merged
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
7 changes: 5 additions & 2 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ extends:
- plugin:lit/recommended

plugins:
- copyright
- '@typescript-eslint'

parser: '@typescript-eslint/parser'
Expand All @@ -34,7 +33,6 @@ rules:
- error
- nofunc
no-var: error
copyright/copyright: error
jsdoc/require-param-type: off
jsdoc/require-property-type: off
jsdoc/require-returns-type: off
Expand All @@ -61,6 +59,11 @@ rules:
'@typescript-eslint/no-misused-promises': warn
'@typescript-eslint/require-await': warn
'@typescript-eslint/no-unsafe-argument': warn
'@typescript-eslint/no-unused-vars': warn
'@typescript-eslint/no-unused-expressions': warn
'@typescript-eslint/prefer-promise-reject-errors': warn
# TODO: Remove before release 2.9
'@typescript-eslint/no-require-imports': warn
'@typescript-eslint/no-useless-constructor': error
'@typescript-eslint/prefer-for-of': error
'@typescript-eslint/prefer-includes': error
Expand Down
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ examples-hosted-apps: .build/gmf-apps.timestamp
npm run build-gmf-apps
touch $@

.build/node_modules.copyright.timestamp: .build/node_modules.timestamp
npm install --no-save --omit=optional --no-package-lock ./buildtools/copyright
touch $@

.build/eslint.timestamp: .build/node_modules.copyright.timestamp .eslintrc.yaml \
.build/eslint.timestamp: .eslintrc.yaml \
$(API_JS_FILES) \
$(NGEO_JS_FILES) \
$(NGEO_TEST_JS_FILES) \
Expand All @@ -212,24 +208,24 @@ examples-hosted-apps: .build/gmf-apps.timestamp
$(GMF_EXAMPLES_JS_FILES) \
$(GMF_APPS_JS_FILES) \
$(BUILD_JS_FILES)
./node_modules/.bin/eslint $(filter-out .build/node_modules.copyright.timestamp .eslintrc.yaml, $^)
./node_modules/.bin/eslint $(filter-out .eslintrc.yaml, $^)
touch $@

.build/eslint-ts.timestamp: .build/node_modules.copyright.timestamp .eslintrc.yaml \
.build/eslint-ts.timestamp: .eslintrc.yaml \
$(TS_FILES)
./node_modules/.bin/eslint --max-warnings=0 $(filter-out .build/node_modules.copyright.timestamp .eslintrc.yaml .eslintrc-ts.yaml, $^)
./node_modules/.bin/eslint --max-warnings=0 $(filter-out .eslintrc.yaml .eslintrc-ts.yaml, $^)
touch $@

.PHONY: eslint-fix
eslint-fix: .build/node_modules.copyright.timestamp .eslintrc.yaml \
eslint-fix: .eslintrc.yaml \
$(API_JS_FILES) \
$(NGEO_JS_FILES) \
$(NGEO_TEST_JS_FILES) \
$(NGEO_EXAMPLES_JS_FILES) \
$(GMF_EXAMPLES_JS_FILES) \
$(GMF_APPS_JS_FILES) \
$(BUILD_JS_FILES)
./node_modules/.bin/eslint --fix $(filter-out .build/node_modules.copyright.timestamp .eslintrc.yaml, $^)
./node_modules/.bin/eslint --fix $(filter-out .eslintrc.yaml, $^)

.build/examples-hosted/partials: examples/partials/
mkdir -p $(dir $@)
Expand Down
4 changes: 0 additions & 4 deletions buildtools/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
extends:
- eslint:recommended

plugins:
- copyright

parserOptions:
sourceType: module
ecmaVersion: 2020
Expand All @@ -23,4 +20,3 @@ rules:
- error
- nofunc
no-var: error
copyright/copyright: error
2 changes: 1 addition & 1 deletion buildtools/codeshift-js2ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ function visit(indent, node, call) {
if (!done) {
console.log('Unknown node type');
console.log(node);
throw 'Unknown node type';
throw new Error('Unknown node type');
}
}

Expand Down
177 changes: 0 additions & 177 deletions buildtools/copyright/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions buildtools/copyright/package-lock.json

This file was deleted.

6 changes: 0 additions & 6 deletions buildtools/copyright/package.json

This file was deleted.

1 change: 1 addition & 0 deletions buildtools/svg-viewbox-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = function (source) {
let tokens = simpleHTMLTokenizer.tokenize(source);

tokens = tokens.map((tag) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
if (tag.type === 'StartTag' && tag.tagName === 'svg') {
let width = undefined;
let height = undefined;
Expand Down
3 changes: 1 addition & 2 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rules:
copyright/copyright: 0
rules: {}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
"@types/sinon": "17.0.3",
"@types/tinycolor2": "1.4.6",
"@types/typeahead": "0.11.32",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@typescript-eslint/eslint-plugin": "8.2.0",
"@typescript-eslint/parser": "8.2.0",
"angular": "1.8.3",
"angular-animate": "1.8.3",
"angular-dynamic-locale": "0.1.38",
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function bootstrap(module) {
angular.bootstrap(document, [appName]);
})
.catch((error) => {
window.alert(`Failed to get the dynamic: ${error}`);
window.alert(`Failed to get the dynamic: ${error}`); // eslint-disable-line @typescript-eslint/no-base-to-string
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/e2e/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ if (Cypress.browser.isHeaded) {
cy.wrap(btn)
.click({force: true})
.then((btn) => {
expect(btn).to.not.be.visible;
expect(btn).to.not.be.visible; // eslint-disable-line @typescript-eslint/no-unused-expressions

// Check the placeholder
cy.get('.tt-input').should('have.attr', 'placeholder', 'Search…');
Expand Down
3 changes: 2 additions & 1 deletion src/lidar/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export class LidarprofileManager {
this.processBuffer_(data, iter, distanceOffset, lastLOD, resetPlot);
})
.catch((err: Error) => {
throw `Error on pytree query: ${err.message}`;
throw new Error(`Error on pytree query: ${err.message}`);
});
}

Expand Down Expand Up @@ -470,6 +470,7 @@ export class LidarprofileManager {

try {
JSON.parse(strHeaderLocal);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
if (!this.isPlotSetup_) {
const canvas: any = d3select(lidarContainerElement.querySelector('.lidar-canvas'));
Expand Down
2 changes: 1 addition & 1 deletion src/lidar/PanelElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default class GmfLidarPanel extends ToolPanelElement {
* @param key The key string of the toggled classification.
*/
toggleVisibility(classification: LidarprofileServerConfigClassification, key: string): void {
classification.visible === 0 ? (classification.visible = 1) : (classification.visible = 0);
classification.visible = classification.visible === 0 ? 1 : 0;
this.setClassification(classification, parseInt(key));
}

Expand Down
2 changes: 1 addition & 1 deletion src/lidar/Plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export default class {
source.clear();
const lidarPointGeom = new olGeomPoint([p.coords[0], p.coords[1]]);
const lidarPointFeature = new olFeature(lidarPointGeom);
if (typeof pointClassification.color !== undefined) {
if (pointClassification.color !== undefined) {
lidarPointFeature.setStyle(
new olStyleStyle({
image: new olStyleCircle({
Expand Down
2 changes: 1 addition & 1 deletion src/message/Disclaimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class MessageDisclaimerService extends ngeoMessageMessage {
jqueryObj.alert('close');
}
} else {
console.log(`No disclaimer found for '${message}'.`);
console.log(`No disclaimer found for '${message.msg}'.`);
}

// (3) Remove message from cache since it's closed now.
Expand Down
8 changes: 4 additions & 4 deletions src/message/Notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ export class MessageNotification extends ngeoMessageMessage {

const classNames = ['alert', 'fade', 'show'];
switch (type) {
case MessageType.ERROR:
case MessageType.ERROR: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-danger');
break;
case MessageType.INFORMATION:
case MessageType.INFORMATION: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-info');
break;
case MessageType.SUCCESS:
case MessageType.SUCCESS: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-success');
break;
case MessageType.WARNING:
case MessageType.WARNING: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison
classNames.push('alert-warning');
break;
default:
Expand Down
Loading
Loading