Skip to content

Commit 45b91df

Browse files
Update for v3 spec (#18)
* Update for v3 spec * Update snapshots and allow legacy solutions * Add workflows, binaries, and changes to docs * Make executable * Update yarn.lock * Add missing e2e script * Make executable * Format all the things * Fix file extensions
1 parent 8f607c9 commit 45b91df

File tree

143 files changed

+11297
-8482
lines changed

Some content is hidden

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

143 files changed

+11297
-8482
lines changed

.babelrc

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
{
22
"presets": [
3-
["@babel/preset-env", { "targets": { "node": "current" } } ],
4-
"@babel/preset-typescript",
3+
[
4+
"@babel/preset-env",
5+
{
6+
"useBuiltIns": "usage",
7+
"corejs": "3.9",
8+
"targets": {
9+
"node": "14.16"
10+
}
11+
12+
}
13+
],
14+
"@babel/preset-typescript"
15+
],
16+
"plugins": [
17+
"@babel/plugin-proposal-optional-chaining",
18+
[
19+
"module-resolver",
20+
{
21+
"alias": {
22+
"~src": "./src",
23+
"~test": "./test"
24+
}
25+
}
26+
]
527
]
628
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ production_node_modules/*
66
test/fixtures/*
77
tmp/*
88
jest.config.js
9+
10+
/scripts

.eslintrc

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"parser": "@typescript-eslint/parser",
44
"parserOptions": {
55
"project": "./tsconfig.json",
6-
"ecmaVersion": 6,
6+
"ecmaVersion": 2018,
77
"sourceType": "module",
88
"ecmaFeatures": {
99
"modules": true
@@ -13,21 +13,28 @@
1313
"es6": true,
1414
"node": true
1515
},
16+
"plugins": ["import", "@typescript-eslint"],
1617
"extends": [
1718
"eslint:recommended",
1819
"plugin:@typescript-eslint/eslint-recommended",
19-
"plugin:@typescript-eslint/recommended"
20+
"plugin:@typescript-eslint/recommended",
21+
"prettier",
22+
"plugin:import/errors",
23+
"plugin:import/warnings",
24+
"plugin:import/typescript"
2025
],
2126
"rules": {
2227
"@typescript-eslint/explicit-function-return-type": [
23-
"warn", {
28+
"warn",
29+
{
2430
"allowExpressions": false,
2531
"allowTypedFunctionExpressions": true,
2632
"allowHigherOrderFunctions": true
2733
}
2834
],
2935
"@typescript-eslint/explicit-member-accessibility": [
30-
"warn", {
36+
"warn",
37+
{
3138
"accessibility": "no-public",
3239
"overrides": {
3340
"accessors": "explicit",
@@ -38,27 +45,28 @@
3845
}
3946
}
4047
],
41-
"@typescript-eslint/indent": ["error", 2],
42-
"@typescript-eslint/no-inferrable-types": [
43-
"error", {
44-
"ignoreParameters": true
45-
}
46-
],
4748
"@typescript-eslint/no-non-null-assertion": "off",
4849
"@typescript-eslint/no-parameter-properties": [
49-
"warn", {
50+
"warn",
51+
{
5052
"allows": [
51-
"private", "protected", "public",
52-
"private readonly", "protected readonly", "public readonly"
53+
"private",
54+
"protected",
55+
"public",
56+
"private readonly",
57+
"protected readonly",
58+
"public readonly"
5359
]
5460
}
5561
],
5662
"@typescript-eslint/no-unused-vars": "off",
5763
"@typescript-eslint/no-use-before-define": [
58-
"error", {
64+
"error",
65+
{
5966
"functions": false,
6067
"typedefs": false
6168
}
62-
]
69+
],
70+
"import/no-unresolved": "off"
6371
}
6472
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name: Bug report
33
about: Report issues with running or developing these analyzers
44
title: 'Bug:'
5-
labels: ":bug: bug"
5+
labels: ':bug: bug'
66
assignees: ''
7-
87
---
98

109
<!-- This is **not** for reporting incorrect _analysis_. Use the Incorrect Analysis template -->
@@ -14,6 +13,7 @@ A clear and concise description of what the bug is.
1413

1514
**To Reproduce**
1615
Steps to reproduce the behavior:
16+
1717
1. Go to '...'
1818
2. Click on '....'
1919
3. Scroll down to '....'
@@ -26,9 +26,10 @@ A clear and concise description of what you expected to happen.
2626
If applicable, add screenshots to help explain your problem.
2727

2828
**Desktop (please complete the following information):**
29-
- OS: [e.g. iOS]
30-
- Browser [e.g. chrome, safari]
31-
- Version [e.g. 22]
29+
30+
- OS: [e.g. iOS]
31+
- Browser [e.g. chrome, safari]
32+
- Version [e.g. 22]
3233

3334
**Additional context**
3435
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ''
5-
labels: ":unicorn: enhancement"
5+
labels: ':unicorn: enhancement'
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/ISSUE_TEMPLATE/incorrect-analysis.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name: Incorrect Analysis
33
about: Report an incorrect analysis
44
title: 'Incorrect Analysis: '
5-
labels: ":bug: bug"
5+
labels: ':bug: bug'
66
assignees: ''
7-
87
---
98

109
**Describe the incorrectness**
@@ -13,10 +12,11 @@ A clear and concise description of what you think is incorrect.
1312
**Which exercise**
1413

1514
**Source file(s)**
15+
1616
```typescript
1717
// source file: <slug>.ts
18-
1918
```
19+
2020
**Expected analysis**
2121
A clear and concise description of what you expected to happen.
2222

.github/workflows/ci.js.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow will do a clean install of node dependencies and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: typescript-analyzer / main
5+
6+
on:
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
precheck:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js LTS (14.x)
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 14.x
20+
21+
- name: Install project dependencies
22+
run: yarn install --frozen-lockfile --ignore-scripts
23+
24+
- name: Run exercism/typescript-analyzer ci precheck (lint code)
25+
run: yarn lint
26+
27+
ci:
28+
runs-on: ubuntu-latest
29+
30+
strategy:
31+
matrix:
32+
node-version: [12.x, 14.x, 15.x]
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Use Node.js ${{ matrix.node-version }}
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: ${{ matrix.node-version }}
40+
41+
- name: Install project dependencies
42+
run: yarn install --frozen-lockfile --ignore-scripts
43+
44+
- name: Build the analyzer and run the tests (using Node ${{ matrix.node-version }})
45+
run: yarn test
46+
47+
- name: Run end-to-end tests
48+
run: yarn test:e2e

.github/workflows/codeql.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
name: 'codeql'
7+
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
# The branches below must be a subset of the branches above
13+
branches: [main]
14+
schedule:
15+
- cron: '0 14 * * 5'
16+
17+
jobs:
18+
analyze:
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
# Override automatic language detection by changing the below list
25+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
26+
language: ['javascript']
27+
# Learn more...
28+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v2
33+
34+
# Initializes the CodeQL tools for scanning.
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v1
37+
with:
38+
languages: ${{ matrix.language }}
39+
# If you wish to specify custom queries, you can do so here or in a config file.
40+
# By default, queries listed here will override any specified in a config file.
41+
# Prefix the list here with "+" to use these queries and those in the config file.
42+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
44+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
45+
# If this step fails, then you should remove it and run the build manually (see below)
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@v1
48+
49+
# ℹ️ Command-line programs to run using the OS shell.
50+
# 📚 https://git.io/JvXDl
51+
52+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
53+
# and modify them (or add more) to build your code if your project
54+
# uses a compiled language
55+
56+
#- run: |
57+
# make bootstrap
58+
# make release
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push Docker images to DockerHub and ECR
1+
name: typescript-analyzer / deploy
22

33
on:
44
push:

0 commit comments

Comments
 (0)