Skip to content

Commit 2c28b22

Browse files
Merge pull request #2 from ojeytonwilliams/feat/validation
feat: type-checking + linting
2 parents aadd7cb + cf92995 commit 2c28b22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+942
-529
lines changed

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI - Node.js
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
lint:
10+
name: Lint
11+
runs-on: ubuntu-24.04
12+
strategy:
13+
matrix:
14+
node-version: [24]
15+
fail-fast: false
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
28+
id: pnpm-install
29+
with:
30+
run_install: true
31+
32+
- name: Type Check Source Files
33+
run: |
34+
echo pnpm version $(pnpm -v)
35+
pnpm type-check
36+
37+
- name: Lint Source Files
38+
run: pnpm lint

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
.turbo

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODE_OPTIONS=\"--max-old-space-size=7168\" pnpm lint-staged

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

apps/api/.lintstagedrc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/* eslint-disable filenames-simple/naming-convention */
2-
import { createLintStagedConfig } from '@freecodecamp/eslint-config/lintstaged';
2+
import { createLintStagedConfig } from "@freecodecamp/eslint-config/lintstaged";
33

44
export default createLintStagedConfig(import.meta.dirname);

apps/api/configs/paths.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { join } from "path";
2-
import * as dotenv from 'dotenv';
2+
import * as dotenv from "dotenv";
33
dotenv.config();
44

5-
65
export const SUPERBLOCK_META_DIR = join(
76
process.cwd(),
87
process.env.FCC_REPO_LOCATION!,
Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
11
export const superBlockList = [
22
{
3-
name: 'Legacy Responsive Web Design',
4-
path: 'responsive-web-design'
3+
name: "Legacy Responsive Web Design",
4+
path: "responsive-web-design",
55
},
66
{
7-
name: 'Legacy JavaScript Algorithms and Data Structures',
8-
path: 'javascript-algorithms-and-data-structures'
7+
name: "Legacy JavaScript Algorithms and Data Structures",
8+
path: "javascript-algorithms-and-data-structures",
99
},
1010
{
11-
name: 'Front End Development Libraries',
12-
path: 'front-end-development-libraries'
11+
name: "Front End Development Libraries",
12+
path: "front-end-development-libraries",
1313
},
1414
{
15-
name: 'Data Visualization',
16-
path: 'data-visualization'
15+
name: "Data Visualization",
16+
path: "data-visualization",
1717
},
1818
{
19-
name: 'Back End Development and APIs',
20-
path: 'back-end-development-and-apis'
19+
name: "Back End Development and APIs",
20+
path: "back-end-development-and-apis",
2121
},
2222
{
23-
name: 'Quality Assurance',
24-
path: 'quality-assurance'
23+
name: "Quality Assurance",
24+
path: "quality-assurance",
2525
},
2626
{
27-
name: 'Scientific Computing with Python',
28-
path: 'scientific-computing-with-python'
27+
name: "Scientific Computing with Python",
28+
path: "scientific-computing-with-python",
2929
},
3030
{
31-
name: 'Data Analysis with Python',
32-
path: 'data-analysis-with-python'
31+
name: "Data Analysis with Python",
32+
path: "data-analysis-with-python",
3333
},
3434
{
35-
name: 'Information Security',
36-
path: 'information-security'
35+
name: "Information Security",
36+
path: "information-security",
3737
},
3838
{
39-
name: 'Coding Interview Prep',
40-
path: 'coding-interview-prep'
39+
name: "Coding Interview Prep",
40+
path: "coding-interview-prep",
4141
},
4242
{
43-
name: 'Machine Learning with Python',
44-
path: 'machine-learning-with-python'
43+
name: "Machine Learning with Python",
44+
path: "machine-learning-with-python",
4545
},
4646
{
47-
name: 'Relational Databases',
48-
path: 'relational-databases'
47+
name: "Relational Databases",
48+
path: "relational-databases",
4949
},
5050
{
51-
name: 'Responsive Web Design',
52-
path: 'responsive-web-design-22'
51+
name: "Responsive Web Design",
52+
path: "responsive-web-design-22",
5353
},
5454
{
55-
name: 'JavaScript Algorithms and Data Structures',
56-
path: 'javascript-algorithms-and-data-structures-22'
55+
name: "JavaScript Algorithms and Data Structures",
56+
path: "javascript-algorithms-and-data-structures-22",
5757
},
5858
{
59-
name: 'The Odin Project',
60-
path: 'the-odin-project'
59+
name: "The Odin Project",
60+
path: "the-odin-project",
6161
},
6262
{
63-
name: 'College Algebra with Python',
64-
path: 'college-algebra-with-python'
63+
name: "College Algebra with Python",
64+
path: "college-algebra-with-python",
6565
},
6666
{
67-
name: 'Project Euler',
68-
path: 'project-euler'
67+
name: "Project Euler",
68+
path: "project-euler",
6969
},
7070
{
71-
name: '(New) Foundational C# with Microsoft',
72-
path: 'foundational-c-sharp-with-microsoft'
71+
name: "(New) Foundational C# with Microsoft",
72+
path: "foundational-c-sharp-with-microsoft",
7373
},
7474
{
75-
name: 'A2 English for Developers',
76-
path: 'a2-english-for-developers'
75+
name: "A2 English for Developers",
76+
path: "a2-english-for-developers",
7777
},
7878
{
79-
name: 'Rosetta Code',
80-
path: 'rosetta-code'
79+
name: "Rosetta Code",
80+
path: "rosetta-code",
8181
},
8282
{
83-
name: 'Python For Everybody',
84-
path: 'python-for-everybody'
83+
name: "Python For Everybody",
84+
path: "python-for-everybody",
8585
},
8686
{
87-
name: 'B1 English for Developers (Beta)',
88-
path: 'b1-english-for-developers'
87+
name: "B1 English for Developers (Beta)",
88+
path: "b1-english-for-developers",
8989
},
9090
{
91-
name: 'Certified Full Stack Developer',
92-
path: 'full-stack-developer'
91+
name: "Certified Full Stack Developer",
92+
path: "full-stack-developer",
9393
},
9494
{
95-
name: 'A1 Professional Spanish (Beta)',
96-
path: 'a1-professional-spanish'
95+
name: "A1 Professional Spanish (Beta)",
96+
path: "a1-professional-spanish",
9797
},
9898
{
99-
name: 'A2 Professional Spanish (Beta)',
100-
path: 'a2-professional-spanish'
99+
name: "A2 Professional Spanish (Beta)",
100+
path: "a2-professional-spanish",
101101
},
102102
{
103-
name: 'A2 Professional Chinese (Beta)',
104-
path: 'a2-professional-chinese'
103+
name: "A2 Professional Chinese (Beta)",
104+
path: "a2-professional-chinese",
105105
},
106106
{
107-
name: 'Basic HTML',
108-
path: 'basic-html'
107+
name: "Basic HTML",
108+
path: "basic-html",
109109
},
110110
{
111-
name: 'Semantic HTML',
112-
path: 'semantic-html'
111+
name: "Semantic HTML",
112+
path: "semantic-html",
113113
},
114114
{
115-
name: 'A1 Professional Chinese (Beta)',
116-
path: 'a1-professional-chinese'
117-
}
115+
name: "A1 Professional Chinese (Beta)",
116+
path: "a1-professional-chinese",
117+
},
118118
];

apps/api/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { configTypeChecked } from '@freecodecamp/eslint-config/base';
1+
import { configTypeChecked } from "@freecodecamp/eslint-config/base";
22

33
export default configTypeChecked;

apps/api/interfaces/tools.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
type ToolsFunction = (
2-
directory: string
2+
directory: string,
33
) => Promise<{ stdout: string; stderr: string }>;
44

55
type ToolsFunctionWithArg = (
66
directory: string,
7-
start: number
7+
start: number,
88
) => Promise<{ stdout: string; stderr: string }>;
99

1010
export interface ToolsSwitch {
11-
'create-next-step': ToolsFunction;
12-
'create-empty-steps': ToolsFunctionWithArg;
13-
'insert-step': ToolsFunctionWithArg;
14-
'delete-step': ToolsFunctionWithArg;
15-
'update-step-titles': ToolsFunction;
11+
"create-next-step": ToolsFunction;
12+
"create-empty-steps": ToolsFunctionWithArg;
13+
"insert-step": ToolsFunctionWithArg;
14+
"delete-step": ToolsFunctionWithArg;
15+
"update-step-titles": ToolsFunction;
1616
}

apps/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"description": "Editor to help with new challenge structure",
66
"scripts": {
7-
"start": "tsx server.ts",
7+
"dev": "tsx server.ts",
88
"postinstall": "shx cp ./sample.env ./.env",
99
"lint": "eslint --max-warnings 0",
1010
"type-check": "tsc --noEmit"

0 commit comments

Comments
 (0)