Skip to content

Commit 3173fdd

Browse files
authored
chore: upgrade typescript/eslint related dependencies, drop node8 and add node16 CI support (#3628)
* chore: upgrade typescript related dependencies * chore: add issue comment link * chore: fix eslint ci add node16 support and drop node8 support * Revert node16 support * Add specifying nodejs_version install script * support windows platform ci * fix: cross-env bin * fix: move cross-env location and delete outdated code * Delete appveyor.yml #3629 (comment) remove appveyor for fast ci.
1 parent 1ab41c1 commit 3173fdd

File tree

8 files changed

+1152
-699
lines changed

8 files changed

+1152
-699
lines changed

Diff for: .eslintrc.json

-71
This file was deleted.

Diff for: appveyor.yml

-31
This file was deleted.

Diff for: packages/less/.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Gruntfile.js
22
dist/*
33
tmp/*
44
lib/*
5-
test/browser/less.min.js
5+
test/browser/less.min.js
6+
node_modules

Diff for: packages/less/.eslintrc.json

+70-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
11
{
2-
"extends": "../../.eslintrc.json"
3-
}
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2018,
5+
"sourceType": "module"
6+
},
7+
"plugins": ["@typescript-eslint"],
8+
"env": {
9+
"browser": true,
10+
"node": true
11+
},
12+
"globals": {},
13+
"rules": {
14+
"no-eval": 2,
15+
"no-use-before-define": [
16+
2,
17+
{
18+
"functions": false
19+
}
20+
],
21+
"no-undef": 0,
22+
"no-unused-vars": 1,
23+
"no-caller": 2,
24+
"no-eq-null": 1,
25+
"guard-for-in": 2,
26+
"no-implicit-coercion": [
27+
2,
28+
{
29+
"boolean": false,
30+
"string": true,
31+
"number": true
32+
}
33+
],
34+
"no-with": 2,
35+
"no-mixed-spaces-and-tabs": 2,
36+
"no-multiple-empty-lines": 2,
37+
"dot-location": [2, "property"],
38+
"operator-linebreak": [0, "after"],
39+
"keyword-spacing": [2, {}],
40+
"space-unary-ops": [
41+
2,
42+
{
43+
"words": false,
44+
"nonwords": false
45+
}
46+
],
47+
"no-spaced-func": 2,
48+
"space-before-function-paren": [
49+
1,
50+
{
51+
"anonymous": "ignore",
52+
"named": "never"
53+
}
54+
],
55+
"comma-dangle": [2, "never"],
56+
"no-trailing-spaces": 0,
57+
"max-len": [2, 160],
58+
"comma-style": [2, "last"],
59+
"curly": [2, "all"],
60+
"space-infix-ops": 2,
61+
"spaced-comment": 1,
62+
"space-before-blocks": [2, "always"],
63+
"indent": [
64+
2,
65+
4,
66+
{
67+
"SwitchCase": 1
68+
}
69+
]
70+
}
71+
}

Diff for: packages/less/Gruntfile.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = function(grunt) {
1212
// Report the elapsed execution time of tasks.
1313
require("time-grunt")(grunt);
1414

15-
var COMPRESS_FOR_TESTS = false;
1615
var git = require("git-rev");
1716

1817
// Sauce Labs browser
@@ -184,17 +183,11 @@ module.exports = function(grunt) {
184183
// Make the SauceLabs jobs
185184
["all"].concat(browserTests).map(makeJob);
186185

187-
var semver = require('semver');
188186
var path = require('path');
189187

190188
// Handle async / await in Rollup build for tests
191-
// Remove this when Node 6 is no longer supported for the build/test process
192-
const nodeVersion = semver.major(process.versions.node);
193189
const tsNodeRuntime = path.resolve(path.join('node_modules', '.bin', 'ts-node'));
194-
let scriptRuntime = 'node';
195-
if (nodeVersion < 8) {
196-
scriptRuntime = tsNodeRuntime;
197-
}
190+
const crossEnv = path.resolve(path.join('node_modules', '.bin', 'cross-env'));
198191

199192
// Project configuration.
200193
grunt.initConfig({
@@ -209,7 +202,7 @@ module.exports = function(grunt) {
209202
build: {
210203
command: [
211204
/** Browser runtime */
212-
scriptRuntime + " build/rollup.js --dist",
205+
"node build/rollup.js --dist",
213206
/** Copy to repo root */
214207
"npm run copy:root",
215208
/** Node.js runtime */
@@ -219,17 +212,19 @@ module.exports = function(grunt) {
219212
testbuild: {
220213
command: [
221214
"npm run build",
222-
scriptRuntime + " build/rollup.js --browser --out=./tmp/browser/less.min.js"
215+
"node build/rollup.js --browser --out=./tmp/browser/less.min.js"
223216
].join(" && ")
224217
},
225218
testcjs: {
226219
command: "npm run build"
227220
},
228221
testbrowser: {
229-
command: scriptRuntime + " build/rollup.js --browser --out=./tmp/browser/less.min.js"
222+
command: "node build/rollup.js --browser --out=./tmp/browser/less.min.js"
230223
},
231224
test: {
232225
command: [
226+
// https://github.com/TypeStrong/ts-node/issues/693#issuecomment-848907036
227+
crossEnv + " TS_NODE_SCOPE=true",
233228
tsNodeRuntime + " test/test-es6.ts",
234229
"node test/index.js"
235230
].join(' && ')

0 commit comments

Comments
 (0)