Add tslint and prettier to ci

This commit is contained in:
Daniel McNab 2018-10-08 22:36:47 +01:00
parent f4ad36e972
commit 3a405b65d6
5 changed files with 621 additions and 401 deletions

View file

@ -1,19 +1,24 @@
language: rust
matrix:
include:
- rust: stable
- language: rust
rust: stable
script:
- cargo gen-kinds --verify
- cargo gen-tests --verify
- cargo test
# - rust: nightly
# - language: rust
# rust: nightly
# before_script:
# - rustup component add clippy-preview
# - rustup component add rustfmt-preview
# script:
# - cargo fmt --all -- --check || true
# - cargo clippy
- language: node_js
node_js: node
before_script: false
script:
- cd editors/code && npm ci && npm run travis; cd ../..
allow_failures:
- rust nightly

File diff suppressed because it is too large Load diff

View file

@ -17,17 +17,26 @@
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install"
"postinstall": "node ./node_modules/vscode/bin/install",
"lint": "tslint --project .",
"prettier": "prettier **/*.{json,ts}",
"travis": "npm run compile && npm run lint && npm run prettier --list-different"
},
"prettier": {
"tabWidth": 4
},
"dependencies": {
"vscode-languageclient": "^4.4.0"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/node": "^8.10.34",
"prettier": "^1.14.3",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"typescript": "^2.6.1",
"vscode": "^1.1.21",
"vsce": "^1.42.0",
"@types/node": "^8.10.25",
"@types/mocha": "^2.2.42"
"vsce": "^1.51.1",
"vscode": "^1.1.21"
},
"activationEvents": [
"onLanguage:rust"

View file

@ -3,21 +3,21 @@ import * as vscode from 'vscode';
import { Server } from './server';
export class Config {
public highlightingOn = true;
public highlightingOn = true;
constructor() {
vscode.workspace.onDidChangeConfiguration((_) => this.userConfigChanged());
this.userConfigChanged();
constructor() {
vscode.workspace.onDidChangeConfiguration((_) => this.userConfigChanged());
this.userConfigChanged();
}
public userConfigChanged() {
const config = vscode.workspace.getConfiguration('ra-lsp');
if (config.has('highlightingOn')) {
this.highlightingOn = config.get('highlightingOn') as boolean;
}
public userConfigChanged() {
const config = vscode.workspace.getConfiguration('ra-lsp');
if (config.has('highlightingOn')) {
this.highlightingOn = config.get('highlightingOn') as boolean;
}
if (!this.highlightingOn && Server) {
Server.highlighter.removeHighlights();
}
if (!this.highlightingOn && Server) {
Server.highlighter.removeHighlights();
}
}
}

View file

@ -1,13 +1,9 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"quotemark": [true, "single"],
"interface-name": false,
"object-literal-sort-keys": false
},
"rulesDirectory": []
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-config-prettier"],
"rules": {
"quotemark": [true, "single"],
"interface-name": false,
"object-literal-sort-keys": false
}
}