From 27738a9b83c2c982ed84d8947b19cd70ca8ce0d7 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Mon, 2 Sep 2024 19:30:45 +0200 Subject: [PATCH] always run the linters in CI --- .github/workflows/node.js.yml | 1 + package.json | 4 ++-- src/layer/ROSM.tsx | 2 +- src/layer/ROSMWebGL.tsx | 2 +- src/style/RBackground.tsx | 2 +- src/style/RBaseStyle.tsx | 2 +- src/style/RStyleArray.tsx | 4 ++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 4423e72d..44103c6f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -25,6 +25,7 @@ jobs: with: node-version: 20.x - run: npm i + - run: npm run lint - run: npm run build --if-present - run: npm test diff --git a/package.json b/package.json index 4fd91a9a..91f328e3 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "dev": "webpack-cli serve --mode=development --env development --open", "prod": "webpack-cli serve --mode=production --env production --open", "doc:publish": "node scripts/publish-ghpages.js", - "lint": "eslint './{examples,src}/**/*.{ts,tsx}'", - "lint:fix": "eslint './{examples,src}/**/*.{ts,tsx}' --fix", + "lint": "eslint './{examples,src,test}/**/*.{ts,tsx}'", + "lint:fix": "eslint './{examples,src,test}/**/*.{ts,tsx}' --fix", "test": "jest", "codecov": "curl -s https://codecov.io/bash | bash", "prepare": "npm run build:lib", diff --git a/src/layer/ROSM.tsx b/src/layer/ROSM.tsx index 9c5904d7..9074bd2e 100644 --- a/src/layer/ROSM.tsx +++ b/src/layer/ROSM.tsx @@ -9,7 +9,7 @@ import {default as LayerRaster, RLayerRasterProps} from './RLayerRaster'; /** * @propsfor ROSM */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface ROSMProps extends RLayerRasterProps {} /** diff --git a/src/layer/ROSMWebGL.tsx b/src/layer/ROSMWebGL.tsx index a6cc365a..90df910b 100644 --- a/src/layer/ROSMWebGL.tsx +++ b/src/layer/ROSMWebGL.tsx @@ -11,7 +11,7 @@ import {default as RLayerWebGL, RLayerWebGLProps} from './RLayerWebGL'; /** * @propsfor ROSMWebGL */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface ROSMWebGLProps extends RLayerWebGLProps {} /** diff --git a/src/style/RBackground.tsx b/src/style/RBackground.tsx index 371b07d7..844161d2 100644 --- a/src/style/RBackground.tsx +++ b/src/style/RBackground.tsx @@ -8,7 +8,7 @@ import debug from '../debug'; /** * @propsfor RBackground */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface RBackgroundProps extends RBaseStyleProps {} type Background = { diff --git a/src/style/RBaseStyle.tsx b/src/style/RBaseStyle.tsx index 061ec82b..c371ea5e 100644 --- a/src/style/RBaseStyle.tsx +++ b/src/style/RBaseStyle.tsx @@ -6,7 +6,7 @@ import debug from '../debug'; /** * @propsfor RBaseStyle */ -// eslint-disable-next-line @typescript-eslint/no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface RBaseStyleProps extends PropsWithChildren {} /** diff --git a/src/style/RStyleArray.tsx b/src/style/RStyleArray.tsx index 845c4d95..c125957a 100644 --- a/src/style/RStyleArray.tsx +++ b/src/style/RStyleArray.tsx @@ -33,7 +33,7 @@ export default class RStyleArray extends RStyle { if (this.props.render) { const element = this.props.render(f, r); React.Children.map(element.props.children, (child) => { - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type if (React.isValidElement(child) && (child.type as Function) !== RStyle) throw new TypeError('An RStyleArray should contain only RStyle elements'); }); @@ -55,7 +55,7 @@ export default class RStyleArray extends RStyle { render(): JSX.Element { React.Children.map(this.props.children, (child) => { - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type if (React.isValidElement(child) && (child.type as Function) !== RStyle) throw new TypeError('An RStyleArray should contain only RStyle elements'); });