Skip to content

Commit

Permalink
Actually run all linters in CI (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 authored Dec 7, 2023
1 parent 3be47f3 commit 68542b4
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 78 deletions.
3 changes: 2 additions & 1 deletion .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ ignores:
# used on release
- '@changesets/changelog-github'
# internal packages
- '@crackle-private/bootstrap'
- '@crackle/cli'
- '@crackle/core'
- '@crackle/router'
- '@crackle/router' # broken code that needs to be updated in packages/router/src/entries/routes.ts
# testing
- vitest
- '~utils'
Expand Down
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
},
"settings": {
"jest": {
"version": 27 // otherwise ESLint fails because it can't detect Jest version
"version": 29 // otherwise ESLint fails because it can't detect Jest version
},
"react": {
"version": "18" // suppress ESLint warning about missing React version
}
}
}
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,8 @@ jobs:
key: build-${{ github.sha }}
enableCrossOsArchive: true

- name: ESLint
run: pnpm lint:eslint

- name: Prettier
run: pnpm lint:prettier

- name: TypeScript
run: pnpm lint:tsc
- name: Run All Linters
run: pnpm lint

test:
name: Test
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@preconstruct/eslint-plugin-format-js-tag": "^0.4.0",
"depcheck": "^1.4.7",
"eslint": "^8.54.0",
"eslint-config-seek": "^11.3.1",
"eslint-config-seek": "^12.1.1",
"ignore-sync": "^7.0.1",
"prettier": "^2.8.8",
"tsx": "^4.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin-remove-exports/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type { NodePath, Visitor } from '@babel/traverse';
interface Context extends PluginPass {
identifiersToKeep: Set<string>;
opts: {
retainExports?: Array<string>;
retainExports?: string[];
retainDefault?: boolean;
retainIdentifiers?: Array<string>;
retainIdentifiers?: string[];
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/entries/render/css-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function stringifyFileScope({ packageName, filePath }: FileScope): string {
return packageName ? `${filePath}$$$${packageName}` : filePath;
}

const bufferedCSSObjs = new Map<string, Array<CSSObj>>();
const bufferedCSSObjs = new Map<string, CSSObj[]>();
const cssByFileScope = new Map<string, string>();
const localClassNames = new Set<string>();
const composedClassLists = new Array<any>();
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export interface CrackleServer {
close: () => Promise<void>;
}

export type PackageEntryPoint = {
export interface PackageEntryPoint {
isDefaultEntry: boolean;
entryName: string;
entryPath: string;
outputDir: string;
packageDir: string;
getOutputPath: (format: Format, options?: { from?: string }) => string;
};
}
8 changes: 4 additions & 4 deletions packages/core/src/utils/setup-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export type Difference =
| { key: 'order' };

type ExportString = `./${string}`;
type ExportObject = {
interface ExportObject {
types: ExportString | Omit<ExportObject, 'types'>;
import: ExportString;
require: ExportString;
};
}
type Exports = Record<string, ExportString | ExportObject>;

const structuredClone = global.structuredClone ?? structuredClonePolyfill;
Expand Down Expand Up @@ -74,7 +74,7 @@ const getExportsForPackage = (entries: Entry[], options: { from: string }) => {
}
exports[makeRelative('package.json')] = makeRelative('package.json');

return exports;
return exports as PackageJson['exports'];
};

const getSideEffectsForPackage = (
Expand Down Expand Up @@ -259,7 +259,7 @@ export const updatePackageJsonExports = async (
}
packageExports[lastKey] = lastExport;

packageJson.exports = packageExports;
packageJson.exports = packageExports as PackageJson['exports'];

await writePackageJson({
dir: packageRoot,
Expand Down
Loading

0 comments on commit 68542b4

Please sign in to comment.