Skip to content

Commit

Permalink
Start re-enable linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rajsite committed Jan 15, 2025
1 parent 4cc19f7 commit 0cc4e85
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 50 deletions.
2 changes: 1 addition & 1 deletion packages/utilities/fast-colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint": "npm run eslint",
"format": "npm run eslint:fix",
"test": "npm run build:tests && npm run unit-tests",
"build:tests": "npm run clean:dist && tsc -p ./tsconfig.test.json && npm run doc",
"build:tests": "tsc -p ./tsconfig.test.json",
"clean:dist": "rimraf dist",
"doc": "api-extractor run --local",
"prettier": "prettier --config ../../../.prettierrc --write \"**/*.ts\"",
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/color-blending.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand All @@ -16,7 +16,6 @@ import {
lightenViaLAB,
saturateViaLCH,
} from "./index.js";
const expect = chai.expect;
const testPrecision: number = 4;

describe("Color blending functions", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/color-converters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand Down Expand Up @@ -28,7 +28,6 @@ import {
xyzToLAB,
xyzToRGB,
} from "./index.js";
const expect = chai.expect;

const testPrecision: number = 4;

Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/color-palette.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand All @@ -9,7 +9,6 @@ import {
} from "./color-palette.js";
import { ColorRGBA64 } from "./color-rgba-64.js";
import { parseColorHexRGB } from "./parse-color.js";
const expect = chai.expect;

const testPrecision: number = 4;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { test200ImageData } from "./__test__/test200.js";
import { testGrey200ImageData } from "./__test__/testGrey200.js";
import { ArrayPixelBlob } from "./array-pixel-blob.js";
import { quantize, QuantizedColor } from "./color-quantization.js";
const expect = chai.expect;

describe("Generating a histogram from an image", (): void => {
test("quantize with default settings", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/histogram.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { test200ImageData } from "./__test__/test200.js";
import { Histogram } from "./histogram.js";
import { ArrayPixelBlob } from "./array-pixel-blob.js";
const expect = chai.expect;

describe("Generating a histogram from an image", (): void => {
test("getHistogramIndex", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/palette-extractor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { test200ImageData } from "./__test__/test200.js";
import { testGrey200ImageData } from "./__test__/testGrey200.js";
import { ArrayPixelBlob } from "./array-pixel-blob.js";
import { quantize, QuantizedColor } from "./color-quantization.js";
import { extractPalette, PaletteEntry } from "./palette-extractor.js";
const expect = chai.expect;

describe("Extracting a palette from a set of colors", (): void => {
test("Extract palette with default settings", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/parse-color.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand All @@ -16,7 +16,6 @@ import {
parseColorWebRGB,
parseColorWebRGBA,
} from "./index.js";
const expect = chai.expect;

const testPrecision: number = 4;
const hexDigits: string[] = [
Expand Down
6 changes: 6 additions & 0 deletions packages/utilities/fast-eslint-rules/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,11 @@ module.exports = {
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["**/*.spec.*"],
rules: {
"@typescript-eslint/no-unused-expressions": "off"
}
}
],
};
2 changes: 1 addition & 1 deletion packages/utilities/fast-react-wrapper/src/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ for (const scenario of scenarios) {
let el: CustomElement;

const renderReactComponent = (
/* eslint-disable-next-line @typescript-eslint/ban-types */
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
props?: {}
) => {
ReactDOM.render(
Expand Down
5 changes: 2 additions & 3 deletions packages/utilities/fast-web-utilities/src/dom.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as chaiIn from "chai";
import { expect } from "chai";
import { expect, use } from "chai";
import spies from "chai-spies";
import {
canUseCssGrid,
Expand All @@ -12,7 +11,7 @@ import {
} from "./dom";
import { KeyCodes } from "./key-codes";

const chai = chaiIn.use(spies);
const chai = use(spies);

describe("isHTMLElement", () => {
document.body.innerHTML = `
Expand Down
14 changes: 3 additions & 11 deletions packages/web-components/fast-element/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@
"rules": {
"max-classes-per-file": "off",
"no-case-declarations": "off",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"{}": false,
"Function": false,
"Object": false
},
"extendDefaults": true
}
],
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@typescript-eslint/no-wrapper-object-types": "error",
"@typescript-eslint/no-use-before-define": ["error", { "typedefs": false }],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-function-return-type": [
Expand Down
14 changes: 3 additions & 11 deletions packages/web-components/fast-foundation/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,9 @@
"leadingUnderscore": "allow"
}
],
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"{}": false,
"Function": false,
"Object": false
},
"extendDefaults": true
}
],
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@typescript-eslint/no-wrapper-object-types": "error",
"import/extensions": [
"error",
"always",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { css, DOM, FASTElement, html, Observable } from "@ni/fast-element";
import * as chaiIn from "chai";
import { expect } from "chai";
import { expect, use } from "chai";
import spies from "chai-spies";
import { DesignSystem } from "../design-system";
import { uniqueElementName } from "../test-utilities/fixture";
import { FoundationElement } from "../foundation-element";
import { CSSDesignToken, DesignToken, DesignTokenChangeRecord, DesignTokenSubscriber } from "./design-token";

const chia = chaiIn.use(spies);
const chia = use(spies);
const elementName = uniqueElementName();

DesignSystem.getOrCreate()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { DI, Container, inject, InterfaceSymbol, Registration, singleton } from "./di";
import * as chaiIn from "chai";
import { expect } from "chai";
import { expect, use } from "chai";
import spies from "chai-spies";

const chai = chaiIn.use(spies);
const chai = use(spies);

describe("DI.singleton", function () {
describe("registerInRequester", function () {
Expand Down
5 changes: 2 additions & 3 deletions packages/web-components/fast-foundation/src/di/di.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import {
singleton,
transient,
} from "./di";
import * as chaiIn from "chai";
import { expect } from "chai";
import { expect, use } from "chai";
import spies from "chai-spies";
import { customElement, FASTElement, html, ref } from "@ni/fast-element";

const chai = chaiIn.use(spies);
const chai = use(spies);

function decorator(): ClassDecorator {
return (target: any) => target;
Expand Down

0 comments on commit 0cc4e85

Please sign in to comment.