Skip to content

Update for v3 spec #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
{
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } } ],
"@babel/preset-typescript",
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": "3.9",
"targets": {
"node": "14.16"
}

}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
[
"module-resolver",
{
"alias": {
"~src": "./src",
"~test": "./test"
}
}
]
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ production_node_modules/*
test/fixtures/*
tmp/*
jest.config.js

/scripts
38 changes: 23 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 6,
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"modules": true
Expand All @@ -13,21 +13,28 @@
"es6": true,
"node": true
},
"plugins": ["import", "@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": [
"warn", {
"warn",
{
"allowExpressions": false,
"allowTypedFunctionExpressions": true,
"allowHigherOrderFunctions": true
}
],
"@typescript-eslint/explicit-member-accessibility": [
"warn", {
"warn",
{
"accessibility": "no-public",
"overrides": {
"accessors": "explicit",
Expand All @@ -38,27 +45,28 @@
}
}
],
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/no-inferrable-types": [
"error", {
"ignoreParameters": true
}
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-parameter-properties": [
"warn", {
"warn",
{
"allows": [
"private", "protected", "public",
"private readonly", "protected readonly", "public readonly"
"private",
"protected",
"public",
"private readonly",
"protected readonly",
"public readonly"
]
}
],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": [
"error", {
"error",
{
"functions": false,
"typedefs": false
}
]
],
"import/no-unresolved": "off"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Bug report
about: Report issues with running or developing these analyzers
title: 'Bug:'
labels: ":bug: bug"
labels: ':bug: bug'
assignees: ''

---

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

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -26,9 +26,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ":unicorn: enhancement"
labels: ':unicorn: enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/incorrect-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Incorrect Analysis
about: Report an incorrect analysis
title: 'Incorrect Analysis: '
labels: ":bug: bug"
labels: ':bug: bug'
assignees: ''

---

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

**Source file(s)**

```typescript
// source file: <slug>.ts

```

**Expected analysis**
A clear and concise description of what you expected to happen.

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/ci.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will do a clean install of node dependencies and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: typescript-analyzer / main

on:
push:
branches: [main]

jobs:
precheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js LTS (14.x)
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install project dependencies
run: yarn install --frozen-lockfile --ignore-scripts

- name: Run exercism/typescript-analyzer ci precheck (lint code)
run: yarn lint

ci:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install project dependencies
run: yarn install --frozen-lockfile --ignore-scripts

- name: Build the analyzer and run the tests (using Node ${{ matrix.node-version }})
run: yarn test

- name: Run end-to-end tests
run: yarn test:e2e
61 changes: 61 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: 'codeql'

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 14 * * 5'

jobs:
analyze:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push Docker images to DockerHub and ECR
name: typescript-analyzer / deploy

on:
push:
Expand Down
Loading