Skip to content

Commit 028bea0

Browse files
committed
Added all required content
1 parent bca878c commit 028bea0

Some content is hidden

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

63 files changed

+8695
-1
lines changed

.eslintrc.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es6: true,
6+
node: true,
7+
jest: true,
8+
},
9+
plugins: ['no-autofix'],
10+
extends: ['eslint:recommended'],
11+
parserOptions: {
12+
ecmaVersion: 2020,
13+
},
14+
rules: {
15+
'no-console': 'off',
16+
'no-var': 'error',
17+
'prefer-const': 'off',
18+
'no-autofix/prefer-const': 'warn',
19+
'new-cap': 'error',
20+
'no-useless-computed-key': 'error',
21+
eqeqeq: 'error',
22+
'no-restricted-syntax': [
23+
'warn',
24+
{
25+
selector:
26+
"ExpressionStatement > CallExpression > MemberExpression > Identifier[name='map']",
27+
message: 'Results from `map` are unused. Replace `map` with `forEach`.',
28+
},
29+
{
30+
selector: "MemberExpression[property.name='innerText']",
31+
message:
32+
'The assignment tests do not support `innerText`. Please replace with `textContent`.',
33+
},
34+
{
35+
selector: "MemberExpression[property.name='innerHTML']",
36+
message:
37+
'Please do not use `innerHTML` in the assignment. Use `textContent` and/or `document.createElement()` instead.',
38+
},
39+
{
40+
selector: 'ForInStatement',
41+
message: 'Avoid `for in` loops. Prefer `Object.keys()` instead.',
42+
},
43+
],
44+
},
45+
};

.github/workflows/classroom.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Autograding Tests
2+
'on':
3+
- push
4+
- repository_dispatch
5+
permissions:
6+
checks: write
7+
actions: read
8+
contents: read
9+
jobs:
10+
run-autograding-tests:
11+
runs-on: ubuntu-latest
12+
if: github.actor != 'github-classroom[bot]'
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
- name: ex1
17+
id: ex1
18+
uses: classroom-resources/autograding-command-grader@v1
19+
with:
20+
test-name: ex1
21+
setup-command: npm install
22+
command: npx jest ex1
23+
timeout: 5
24+
max-score: 1
25+
- name: ex2
26+
id: ex2
27+
uses: classroom-resources/autograding-command-grader@v1
28+
with:
29+
test-name: ex2
30+
setup-command: npm install
31+
command: npx jest ex2
32+
timeout: 5
33+
max-score: 1
34+
- name: ex3
35+
id: ex3
36+
uses: classroom-resources/autograding-command-grader@v1
37+
with:
38+
test-name: ex3
39+
setup-command: npm install
40+
command: npx jest ex3
41+
timeout: 5
42+
max-score: 1
43+
- name: ex4
44+
id: ex4
45+
uses: classroom-resources/autograding-command-grader@v1
46+
with:
47+
test-name: ex4
48+
setup-command: npm install
49+
command: npx jest ex4
50+
timeout: 5
51+
max-score: 1
52+
- name: Autograding Reporter
53+
uses: classroom-resources/autograding-grading-reporter@v1
54+
env:
55+
EX1_RESULTS: '${{steps.ex1.outputs.result}}'
56+
EX2_RESULTS: '${{steps.ex2.outputs.result}}'
57+
EX3_RESULTS: '${{steps.ex3.outputs.result}}'
58+
EX4_RESULTS: '${{steps.ex4.outputs.result}}'
59+
with:
60+
runners: ex1,ex2,ex3,ex4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,7 @@ dist
134134
.yarn/build-state.yml
135135
.yarn/install-state.gz
136136
.pnp.*
137+
138+
# Solution files (for testing unit tests)
139+
solutions/
140+
toggle-folders.sh

.markdownlint.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"default": true,
3+
"line-length": false,
4+
"no-inline-html": false,
5+
"no-duplicate-header": false,
6+
"table-pipe-style": false
7+
}

.vscode/extensions.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"aaron-bond.better-comments",
6+
"bierner.github-markdown-preview",
7+
"bierner.markdown-checkbox",
8+
"bierner.markdown-emoji",
9+
"bierner.markdown-preview-github-styles",
10+
"dbaeumer.vscode-eslint",
11+
"esbenp.prettier-vscode",
12+
"ritwickdey.LiveServer",
13+
"streetsidesoftware.code-spell-checker"
14+
]
15+
}

.vscode/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"editor.detectIndentation": false,
3+
"editor.formatOnSave": true,
4+
"editor.minimap.enabled": false,
5+
"editor.tabSize": 2,
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll": "explicit"
8+
},
9+
"files.autoSave": "onFocusChange",
10+
"prettier.trailingComma": "es5",
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"[javascript]": {
13+
// override possible JavaScript specific user setting
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
16+
"editor.bracketPairColorization.enabled": true,
17+
"editor.guides.bracketPairs": true,
18+
"editor.guides.highlightActiveIndentation": true,
19+
"editor.guides.bracketPairsHorizontal": "active"
20+
}

0 commit comments

Comments
 (0)