Skip to content

Commit 02e7101

Browse files
authored
feat: Add ESLint (#13)
1 parent 566f76a commit 02e7101

Some content is hidden

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

41 files changed

+4232
-3547
lines changed

.editorconfig

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
root = true
2-
3-
[*]
4-
insert_final_newline = true
5-
indent_style = space
6-
indent_size = 2
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf

.eslintrc.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright (C) Daniel Kuschny (Danielku15) and contributors.
3+
* Copyright (C) Microsoft Corporation. All rights reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style
6+
* license that can be found in the LICENSE file or at
7+
* https://opensource.org/licenses/MIT.
8+
*/
9+
10+
module.exports = {
11+
env: {
12+
browser: true,
13+
es2021: true,
14+
},
15+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
16+
overrides: [
17+
{
18+
env: {
19+
node: true,
20+
},
21+
files: ['.eslintrc.{js,cjs}'],
22+
parserOptions: {
23+
sourceType: 'script',
24+
},
25+
},
26+
],
27+
ignorePatterns: ['out/**', 'test-workspaces/**', 'src/typings/**', 'resources/**'],
28+
parser: '@typescript-eslint/parser',
29+
parserOptions: {
30+
ecmaVersion: 'latest',
31+
sourceType: 'module',
32+
},
33+
plugins: ['@typescript-eslint', 'license-header'],
34+
rules: {
35+
indent: ['error', 2],
36+
'linebreak-style': ['error', 'unix'],
37+
quotes: ['error', 'single'],
38+
semi: ['error', 'always'],
39+
'@typescript-eslint/no-explicit-any': 'off',
40+
'@typescript-eslint/no-var-requires': 'off',
41+
'prefer-const': ['error', { destructuring: 'all' }],
42+
'license-header/header': ['error', './resources/license-header.js'],
43+
},
44+
};

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/dependabot.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
version: 2
2-
updates:
3-
- package-ecosystem: 'npm'
4-
directory: '/'
5-
schedule:
6-
interval: 'weekly'
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: 'weekly'
7+
ignore:
8+
# VS Code doesn't support ESM and Chai, need to stay on chai 4.x
9+
# https://github.com/microsoft/vscode/issues/160416
10+
# https://github.com/microsoft/vscode/issues/130367
11+
# https://github.com/microsoft/vscode-loader/issues/56
12+
- dependency-name: 'chai'

.github/workflows/build.yml

+62-48
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,62 @@
1-
on:
2-
push:
3-
branches:
4-
- main
5-
pull_request:
6-
workflow_dispatch:
7-
8-
permissions:
9-
contents: read
10-
actions: read
11-
checks: write
12-
13-
jobs:
14-
build:
15-
name: Build and Test
16-
strategy:
17-
fail-fast: false
18-
matrix:
19-
os: [macos-latest, ubuntu-latest, windows-latest]
20-
vscode-version: ['stable', 'insiders']
21-
vscode-platform: ['desktop']
22-
runs-on: ${{ matrix.os }}
23-
env:
24-
VSCODE_TEST_VERSION: ${{matrix.vscode-version}}
25-
VSCODE_TEST_PLATFORM: ${{matrix.vscode-platform}}
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
- name: Install Node.js
30-
uses: actions/setup-node@v4
31-
with:
32-
node-version: lts/*
33-
- run: npm install
34-
- run: npm run compile:test
35-
- name: Print Test Config
36-
run: node ./.vscode-test.mjs
37-
env:
38-
VSCODE_CONFIG_LOG: true
39-
- run: xvfb-run -a npm test
40-
if: runner.os == 'Linux'
41-
- run: npm test
42-
if: runner.os != 'Linux'
43-
- uses: dorny/test-reporter@v1
44-
if: always()
45-
with:
46-
name: VS Code Test Results (${{matrix.os}}, ${{matrix.vscode-version}}, ${{matrix.vscode-platform}})
47-
path: 'test-results/*.json'
48-
reporter: mocha-json
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
actions: read
11+
checks: write
12+
13+
jobs:
14+
build:
15+
name: Build and Test
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [macos-latest, ubuntu-latest, windows-latest]
20+
vscode-version: ['stable', 'insiders']
21+
vscode-platform: ['desktop']
22+
runs-on: ${{ matrix.os }}
23+
env:
24+
VSCODE_TEST_VERSION: ${{matrix.vscode-version}}
25+
VSCODE_TEST_PLATFORM: ${{matrix.vscode-platform}}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Install Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: lts/*
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Compile
39+
run: npm run compile:test
40+
41+
- name: Print Test Config
42+
run: node ./.vscode-test.mjs
43+
env:
44+
VSCODE_CONFIG_LOG: true
45+
46+
- name: Run Tests (Linux)
47+
run: xvfb-run -a npm test
48+
if: runner.os == 'Linux'
49+
- name: Run Tests (Win/MacOS)
50+
run: npm test
51+
if: runner.os != 'Linux'
52+
53+
- name: Run Linter
54+
if: always()
55+
run: npm run lint
56+
57+
- uses: dorny/test-reporter@v1
58+
if: always()
59+
with:
60+
name: VS Code Test Results (${{matrix.os}}, ${{matrix.vscode-version}}, ${{matrix.vscode-platform}})
61+
path: 'test-results/*.json'
62+
reporter: mocha-json

0 commit comments

Comments
 (0)