Skip to content

Commit 9566ff5

Browse files
committed
chore(deps): bump dependencies, use union @1stG configurations
1 parent d45379d commit 9566ff5

34 files changed

+8697
-2887
lines changed

.commitlintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@1stg"
4+
]
5+
}

.commitlintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
.vscode-test
1+
!/.*.js
2+
/.vscode-test
23
lib
34
node_modules

.eslintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"root": true,
3+
"extends": "@1stg",
4+
"settings": {
5+
"node": {
6+
"allowModules": [
7+
"vscode"
8+
]
9+
}
10+
}
11+
}

.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
!.vscode
2-
.vscode-test
1+
*.log
2+
*.tsbuildinfo
3+
.*cache
4+
!/.vscode
5+
/.vscode-test
36
lib
47
node_modules
5-
tsconfig.tsbuildinfo
6-
*.log

.huskyrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.huskyrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@1stg/husky-config')

.lintstagedrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.lintstagedrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@1stg/lint-staged')

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"prettier-config-1stg"
1+
"@1stg/prettier-config"

.renovaterc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"extends": ["1stg"]
2+
"extends": [
3+
"@1stg"
4+
]
35
}

.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ before_install:
1010
- git config --global user.name 'JounQin'
1111
- git config --global user.email '[email protected]'
1212

13-
script:
14-
- yarn lint
15-
- yarn build
13+
install: yarn --frozen-lockfile
14+
15+
script: yarn lint
16+
17+
deploy:
18+
provider: script
19+
skip_cleanup: true
20+
script: bash deploy.sh
21+
on:
22+
branch: master

.vscodeignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.*
22
*.log
3-
*.ts
43
*.map
4+
*.ts
5+
*.tsbuildinfo
6+
deploy.sh
57
tsconfig.json
68
tsconfig.base.json
7-
tsconfig.tsbuildinfo
89
node_modules
910
yarn.lock
1011
!/node_modules/vscode-jsonrpc/**

README.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,56 @@ Adds language support for [MDX].
66

77
You can install this extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=JounQin.vscode-mdx).
88

9-
## What about `.md` files?
9+
## Integration With [VS Code ESLint](https://github.com/microsoft/vscode-eslint)
1010

11-
By default the MDX language is applied only to `.mdx` files. If MDX files in your project end with `.md`, you can tell VS Code that by adding the following to your workspace settings:
11+
1. First of all, you need to enable [eslint-plugin-mdx][] which makes it possible to lint `.mdx` or `.md` files with `ESLint`.
1212

13-
```json
14-
"files.associations": {
15-
"*.md": "mdx"
16-
},
13+
2. And then you will need to enable ESLint validation for `.mdx` and `.md` files like following:
14+
15+
```jsonc
16+
// .vscode/settings.json
17+
{
18+
"eslint.autoFixOnSave": true,
19+
"eslint.options": {
20+
"extensions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx"]
21+
},
22+
"eslint.validate": [
23+
{
24+
"language": "javascript",
25+
"autoFix": true
26+
},
27+
{
28+
"language": "javascriptreact",
29+
"autoFix": true
30+
},
31+
{
32+
"language": "markdown",
33+
"autoFix": true
34+
},
35+
{
36+
"language": "mdx",
37+
"autoFix": true
38+
},
39+
{
40+
"language": "typescript",
41+
"autoFix": true
42+
},
43+
{
44+
"language": "typescriptreact",
45+
"autoFix": true
46+
}
47+
]
48+
}
1749
```
1850

51+
### Markdown Syntax
52+
53+
Markdown Syntax could also be linted via [eslint-plugin-mdx][] and [remark-lint][] plugins.
54+
55+
> it will read [remark][]'s [configuration](https://github.com/remarkjs/remark/tree/master/packages/remark-cli#remark-cli) automatically via [cosmiconfig](https://github.com/davidtheclark/cosmiconfig). But `.remarkignore` will not be respected, you should use `.eslintignore` instead.
56+
57+
More usage detail please refer to [eslint-plugin-mdx][]'s [documentation](https://github.com/rx-ts/eslint-mdx#toc-).
58+
1959
## Auto-close tags
2060

2161
If you want VS Code to automatically close tags while you type, you can install [Auto Close Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag) and configure it to also include the language `mdx`:
@@ -30,3 +70,6 @@ If you want VS Code to automatically close tags while you type, you can install
3070
```
3171

3272
[mdx]: https://github.com/mdx-js/mdx
73+
[eslint-plugin-mdx]: https://github.com/rx-ts/eslint-mdx
74+
[remark]: https://github.com/remarkjs/remark
75+
[remark-lint]: https://github.com/remarkjs/remark-lint

client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"name": "vscode-mdx-client",
33
"version": "0.1.1",
44
"description": "Client of MDX extension for Visual Studio Code",
5+
"repository": "[email protected]:rx-ts/vscode-mdx.git",
56
"author": "JounQin",
67
"publisher": "JounQin",
78
"license": "MIT",
8-
"repository": "[email protected]:rx-ts/vscode-mdx.git",
99
"engines": {
10-
"vscode": "^1.23.0"
10+
"vscode": ">=1.0.0"
1111
},
1212
"dependencies": {
1313
"vscode-languageclient": "^5.2.1"

client/src/extension.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
55

6-
import * as path from 'path'
6+
import path from 'path'
77

88
import {
99
LanguageClient,
1010
LanguageClientOptions,
1111
ServerOptions,
1212
TransportKind,
1313
} from 'vscode-languageclient'
14-
1514
import { workspace, ExtensionContext } from 'vscode'
1615

17-
let client: LanguageClient
16+
let client: LanguageClient | undefined
1817

1918
export function activate(context: ExtensionContext) {
2019
// The server is implemented in node

client/src/test/index.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

client/src/test/completion.test.ts renamed to client/test/completion.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
55

6-
import * as assert from 'assert'
6+
import assert from 'assert'
77

8-
import { getDocUri, activate } from './helper'
8+
import vscode from 'vscode'
99

10-
import * as vscode from 'vscode'
10+
import { getDocUri, activate } from './helper'
1111

1212
async function testCompletion(
1313
docUri: vscode.Uri,
@@ -37,12 +37,12 @@ async function testCompletion(
3737
describe('Should do completion', () => {
3838
const docUri = getDocUri('completion.txt')
3939

40-
it('Completes JS/TS in txt file', async () => {
41-
await testCompletion(docUri, new vscode.Position(0, 0), {
40+
// eslint-disable-next-line jest/expect-expect
41+
it('Completes JS/TS in txt file', () =>
42+
testCompletion(docUri, new vscode.Position(0, 0), {
4243
items: [
4344
{ label: 'JavaScript', kind: vscode.CompletionItemKind.Text },
4445
{ label: 'TypeScript', kind: vscode.CompletionItemKind.Text },
4546
],
46-
})
47-
})
47+
}))
4848
})

client/src/test/diagnostics.test.ts renamed to client/test/diagnostics.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
/* eslint-disable @typescript-eslint/no-magic-numbers */
12
/* --------------------------------------------------------------------------------------------
23
* Copyright (c) Microsoft Corporation. All rights reserved.
34
* Licensed under the MIT License. See License.txt in the project root for license information.
45
* ------------------------------------------------------------------------------------------ */
56

6-
import * as assert from 'assert'
7+
import assert from 'assert'
78

8-
import { getDocUri, activate } from './helper'
9+
import vscode from 'vscode'
910

10-
import * as vscode from 'vscode'
11+
import { getDocUri, activate } from './helper'
1112

1213
function toRange(sLine: number, sChar: number, eLine: number, eChar: number) {
1314
const start = new vscode.Position(sLine, sChar)
@@ -36,8 +37,9 @@ async function testDiagnostics(
3637
describe('Should get diagnostics', () => {
3738
const docUri = getDocUri('diagnostics.txt')
3839

39-
it('Diagnoses uppercase texts', async () => {
40-
await testDiagnostics(docUri, [
40+
// eslint-disable-next-line jest/expect-expect
41+
it('Diagnoses uppercase texts', () =>
42+
testDiagnostics(docUri, [
4143
{
4244
message: 'ANY is all uppercase.',
4345
range: toRange(0, 0, 0, 3),
@@ -56,6 +58,5 @@ describe('Should get diagnostics', () => {
5658
severity: vscode.DiagnosticSeverity.Warning,
5759
source: 'ex',
5860
},
59-
])
60-
})
61+
]))
6162
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
import React from 'react'
23

34
export const Test = () => <div>Hello World</div>

client/testFixture/fixture.mdx renamed to client/test/fixtures/fixture.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing **elit**. Ut ac lobortis <b>v
1717
```
1818

1919
<Test>{/* This is a comment */}</Test>
20-
2120
<Test>
2221
{/** This is a comment */}In JSX!{/** This is a comment */}
2322
</Test>

client/src/test/helper.ts renamed to client/test/helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
55

6-
import * as path from 'path'
6+
import path from 'path'
77

8-
import * as vscode from 'vscode'
8+
import vscode from 'vscode'
99

1010
export let doc: vscode.TextDocument
1111
export let editor: vscode.TextEditor
@@ -26,7 +26,7 @@ export async function activate(docUri: vscode.Uri) {
2626
try {
2727
doc = await vscode.workspace.openTextDocument(docUri)
2828
editor = await vscode.window.showTextDocument(doc)
29-
await sleep(2000) // Wait for server activation
29+
await sleep(2 * 1000) // Wait for server activation
3030
} catch (e) {
3131
console.error(e)
3232
}

client/test/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import path from 'path'
2+
3+
import { runTests } from 'vscode-test'
4+
5+
function main() {
6+
// The folder containing the Extension Manifest package.json
7+
// Passed to `--extensionDevelopmentPath`
8+
const extensionDevelopmentPath = path.resolve(__dirname, '..')
9+
10+
// The path to the extension test script
11+
// Passed to --extensionTestsPath
12+
const extensionTestsPath = path.resolve(__dirname, './suite/index')
13+
14+
// Download VS Code, unzip it and run the integration test
15+
return runTests({ extensionDevelopmentPath, extensionTestsPath })
16+
}
17+
18+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
19+
main()
File renamed without changes.

client/tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"extends": "../tsconfig.base.json",
2+
"extends": "../tsconfig.base",
33
"compilerOptions": {
44
"composite": true,
55
"outDir": "lib",
66
"rootDir": "src"
77
},
8-
"include": ["src"],
9-
"exclude": ["src/test"]
8+
"include": ["src"]
109
}

0 commit comments

Comments
 (0)