Skip to content

Commit

Permalink
Update to ESLint 8.57.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pjonsson committed Nov 21, 2024
1 parent faa41ab commit 1cfde0d
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 200 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
Expand Down Expand Up @@ -35,9 +35,6 @@ module.exports = {
}
},
rules: {
/* ban-types is split in ESLint v8:
https://typescript-eslint.io/rules/ban-types/ */
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/unified-signatures": "error",
"react-hooks/exhaustive-deps": "error",
"react/jsx-boolean-value": ["error", "never", { always: [] }],
Expand Down
39 changes: 26 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,32 @@ gulp.task("watch-specs", function (done) {
});

gulp.task("lint", function (done) {
var runExternalModule = require("./buildprocess/runExternalModule");

runExternalModule("eslint/bin/eslint.js", [
"lib",
"test",
"--ext",
".jsx,.js,.ts,.tsx",
"--ignore-pattern",
"lib/ThirdParty",
"--max-warnings",
"0"
]);

const spawnSync = require("child_process").spawnSync;
// If upgrading to ESLint 9 without changing config file format:
// process.env.ESLINT_USE_FLAT_CONFIG = "false";
const result = spawnSync(
"node_modules/eslint/bin/eslint.js",
[
"lib",
"test",
"--ext",
".jsx,.js,.ts,.tsx",
"--ignore-pattern",
"lib/ThirdParty",
"--max-warnings",
"0"
],
{
stdio: "inherit",
shell: true
}
);
if (result.status !== 0) {
const PluginError = require("plugin-error");
throw new PluginError("eslint", "ESLint exited with an error.", {
showStack: false
});
}
done();
});

Expand Down
3 changes: 2 additions & 1 deletion lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export default class WebMapServiceCapabilitiesStratum extends LoadableStratum(
Array.from(this.capabilitiesLayers.values()).forEach((layer) => {
if (!layer?.MetadataURL) return;
Array.isArray(layer?.MetadataURL)
? metadataUrls.push(...layer?.MetadataURL)
? // eslint-disable-next-line no-unsafe-optional-chaining
metadataUrls.push(...layer?.MetadataURL)
: metadataUrls.push(layer?.MetadataURL as MetadataURL);
});

Expand Down
1 change: 1 addition & 0 deletions lib/Models/Catalog/Ows/WebMapTileServiceCatalogItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ class WebMapTileServiceCatalogItem extends MappableMixin(
let tileMatrixSetLinks: TileMatrixSetLink[] = [];
if (layer?.TileMatrixSetLink) {
if (Array.isArray(layer?.TileMatrixSetLink)) {
// eslint-disable-next-line no-unsafe-optional-chaining
tileMatrixSetLinks = [...layer?.TileMatrixSetLink];
} else {
tileMatrixSetLinks = [layer.TileMatrixSetLink];
Expand Down
1 change: 1 addition & 0 deletions lib/Models/Workflows/TableStylingWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,7 @@ export default class TableStylingWorkflow
),
isOpen: true,
selectableDimensions: filterOutUndefined([
// eslint-disable-next-line no-unsafe-optional-chaining
...traits.enum?.map((enumPoint, idx) => {
const dims: SelectableDimensionGroup = {
type: "group",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"@typescript-eslint/parser": "^6.12.0",
"babel-plugin-styled-components": "^1.10.7",
"bufferutil": "^4.0.8",
"eslint": "^7.20.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
Loading

0 comments on commit 1cfde0d

Please sign in to comment.