Skip to content

Commit

Permalink
more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed May 31, 2024
1 parent bff9c29 commit c7c65bb
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 73 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
8 changes: 5 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnsafeOptionalChaining": "off",
"useExhaustiveDependencies": "off",
"noUnusedImports": "warn"
"noUnusedImports": "warn",
"useJsxKeyInIterable": "off"
},
"complexity": {
"noBannedTypes": "off",
Expand All @@ -31,7 +32,8 @@
"noPrototypeBuiltins": "off",
"noConfusingVoidType": "off",
"noArrayIndexKey": "off",
"noThenProperty": "off"
"noThenProperty": "off",
"noExportsInTest": "off"
},
"performance": {
"noAccumulatingSpread": "off",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export const FlagsProjectChart: VFC<IFlagsProjectChartProps> = ({

const data = useProjectChartData(projectFlagTrends);
const notEnoughData = useMemo(
() =>
!isLoading &&
(data.datasets.some((d) => d.data.length > 1) ? false : true),
() => !isLoading && !data.datasets.some((d) => d.data.length > 1),
[data, isLoading],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ export const ProjectHealthChart: VFC<IProjectHealthChartProps> = ({
: projectsData;
const notEnoughData = useMemo(
() =>
!isLoading &&
(projectsData.datasets.some((d) => d.data.length > 1)
? false
: true),
!isLoading && !projectsData.datasets.some((d) => d.data.length > 1),
[projectsData, isLoading],
);
const data =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export const UsersPerProjectChart: VFC<IUsersPerProjectChartProps> = ({

const data = useProjectChartData(projectFlagTrends);
const notEnoughData = useMemo(
() =>
!isLoading &&
(data.datasets.some((d) => d.data.length > 1) ? false : true),
() => !isLoading && !data.datasets.some((d) => d.data.length > 1),
[data, isLoading],
);

Expand Down
12 changes: 6 additions & 6 deletions frontend/src/component/insights/hooks/usePlaceholderData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export const usePlaceholderData = (
data:
type === 'rising'
? [
3, 5, 15, 17, 25, 40, 47, 48, 55,
65, 62, 72, 75, 73, 80,
]
3, 5, 15, 17, 25, 40, 47, 48, 55,
65, 62, 72, 75, 73, 80,
]
: [
54, 52, 53, 49, 54, 50, 47, 46,
51, 51, 50, 51, 49, 49, 51,
],
54, 52, 53, 49, 54, 50, 47, 46, 51,
51, 50, 51, 49, 49, 51,
],
borderColor: theme.palette.primary.light,
backgroundColor: fill
? fillGradientPrimary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ const useResetPassword = (options: SWRConfiguration = {}) => {
setLoading(!error && !data);
}, [data, error]);

const isValidToken =
const isValidToken = !(
(!loading && data?.name === INVALID_TOKEN_ERROR) ||
data?.name === USED_TOKEN_ERROR
? false
: true;
);

return {
token,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/hooks/useSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export const getColumnValues = (column: any, row: any) => {
? column.accessor(row)
: column.accessor.includes('.')
? column.accessor
.split('.')
.reduce((object: any, key: string) => object?.[key], row)
.split('.')
.reduce((object: any, key: string) => object?.[key], row)
: row[column.accessor];

if (column.filterParsing) {
Expand Down
26 changes: 20 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
"testTimeout": 10000,
"globalSetup": "./scripts/jest-setup.js",
"transform": {
"^.+\\.tsx?$": ["@swc/jest"]
"^.+\\.tsx?$": [
"@swc/jest"
]
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"testPathIgnorePatterns": [
Expand All @@ -88,7 +90,13 @@
"/frontend/",
"/website/"
],
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/dist/",
Expand Down Expand Up @@ -162,7 +170,7 @@
"devDependencies": {
"@apidevtools/swagger-parser": "10.1.0",
"@babel/core": "7.24.5",
"@biomejs/biome": "1.6.4",
"@biomejs/biome": "1.7.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"@types/bcryptjs": "2.4.6",
Expand Down Expand Up @@ -223,9 +231,15 @@
"tough-cookie": "4.1.4"
},
"lint-staged": {
"*.{js,ts}": ["biome check --apply --no-errors-on-unmatched"],
"*.{jsx,tsx}": ["biome check --apply --no-errors-on-unmatched"],
"*.json": ["biome format --write --no-errors-on-unmatched"]
"*.{js,ts}": [
"biome check --apply --no-errors-on-unmatched"
],
"*.{jsx,tsx}": [
"biome check --apply --no-errors-on-unmatched"
],
"*.json": [
"biome format --write --no-errors-on-unmatched"
]
},
"packageManager": "[email protected]"
}
8 changes: 4 additions & 4 deletions src/lib/addons/feature-event-formatter-md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@ export class FeatureEventFormatterMd implements FeatureEventFormatter {
? ''
: !preData
? ` ${propertyName} to ${userIdText(
data?.parameters[propertyName],
)}`
data?.parameters[propertyName],
)}`
: ` ${propertyName} from ${userIdText(
preData.parameters[propertyName],
)} to ${userIdText(data?.parameters[propertyName])}`;
preData.parameters[propertyName],
)} to ${userIdText(data?.parameters[propertyName])}`;
const constraintText = this.constraintChangeText(
preData?.constraints,
data?.constraints,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/features/feature-search/feature-search-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class FeatureSearchStore implements IFeatureSearchStore {
envName,
).andWhere(
'feature_environments.enabled',
envStatus === 'enabled' ? true : false,
envStatus === 'enabled',
);
});
}
Expand Down
76 changes: 38 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -918,18 +918,18 @@ __metadata:
languageName: node
linkType: hard

"@biomejs/biome@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/biome@npm:1.6.4"
dependencies:
"@biomejs/cli-darwin-arm64": "npm:1.6.4"
"@biomejs/cli-darwin-x64": "npm:1.6.4"
"@biomejs/cli-linux-arm64": "npm:1.6.4"
"@biomejs/cli-linux-arm64-musl": "npm:1.6.4"
"@biomejs/cli-linux-x64": "npm:1.6.4"
"@biomejs/cli-linux-x64-musl": "npm:1.6.4"
"@biomejs/cli-win32-arm64": "npm:1.6.4"
"@biomejs/cli-win32-x64": "npm:1.6.4"
"@biomejs/biome@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/biome@npm:1.7.3"
dependencies:
"@biomejs/cli-darwin-arm64": "npm:1.7.3"
"@biomejs/cli-darwin-x64": "npm:1.7.3"
"@biomejs/cli-linux-arm64": "npm:1.7.3"
"@biomejs/cli-linux-arm64-musl": "npm:1.7.3"
"@biomejs/cli-linux-x64": "npm:1.7.3"
"@biomejs/cli-linux-x64-musl": "npm:1.7.3"
"@biomejs/cli-win32-arm64": "npm:1.7.3"
"@biomejs/cli-win32-x64": "npm:1.7.3"
dependenciesMeta:
"@biomejs/cli-darwin-arm64":
optional: true
Expand All @@ -949,62 +949,62 @@ __metadata:
optional: true
bin:
biome: bin/biome
checksum: 10c0/f85a5af7c4b3edb40c97a7a4fa2c78b91367cf31fe27d115d95f5f37d64c2b49091bb34d1495dfc8a053688b01fe9ed5746bc37bc99f0cec6d7915274df45a38
checksum: 10c0/05c95bb4b1fbf1b252cf2124f012f69a00ff5599ecac002b7e3004bfcd927e3d7b5f4935739096b5184653ec96b44ddcc36809d059682e5378bde20c836fb111
languageName: node
linkType: hard

"@biomejs/cli-darwin-arm64@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-darwin-arm64@npm:1.6.4"
"@biomejs/cli-darwin-arm64@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-darwin-arm64@npm:1.7.3"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@biomejs/cli-darwin-x64@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-darwin-x64@npm:1.6.4"
"@biomejs/cli-darwin-x64@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-darwin-x64@npm:1.7.3"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@biomejs/cli-linux-arm64-musl@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-linux-arm64-musl@npm:1.6.4"
"@biomejs/cli-linux-arm64-musl@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-linux-arm64-musl@npm:1.7.3"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@biomejs/cli-linux-arm64@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-linux-arm64@npm:1.6.4"
"@biomejs/cli-linux-arm64@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-linux-arm64@npm:1.7.3"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@biomejs/cli-linux-x64-musl@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-linux-x64-musl@npm:1.6.4"
"@biomejs/cli-linux-x64-musl@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-linux-x64-musl@npm:1.7.3"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@biomejs/cli-linux-x64@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-linux-x64@npm:1.6.4"
"@biomejs/cli-linux-x64@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-linux-x64@npm:1.7.3"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@biomejs/cli-win32-arm64@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-win32-arm64@npm:1.6.4"
"@biomejs/cli-win32-arm64@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-win32-arm64@npm:1.7.3"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@biomejs/cli-win32-x64@npm:1.6.4":
version: 1.6.4
resolution: "@biomejs/cli-win32-x64@npm:1.6.4"
"@biomejs/cli-win32-x64@npm:1.7.3":
version: 1.7.3
resolution: "@biomejs/cli-win32-x64@npm:1.7.3"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
Expand Down Expand Up @@ -9810,7 +9810,7 @@ __metadata:
dependencies:
"@apidevtools/swagger-parser": "npm:10.1.0"
"@babel/core": "npm:7.24.5"
"@biomejs/biome": "npm:1.6.4"
"@biomejs/biome": "npm:1.7.3"
"@slack/web-api": "npm:^6.10.0"
"@swc/core": "npm:1.5.7"
"@swc/jest": "npm:0.2.36"
Expand Down

0 comments on commit c7c65bb

Please sign in to comment.