Skip to content

Commit 7c0f559

Browse files
authored
Merge pull request #264 from oddbird/lint
Use lts/* and lts/-n for node version; work around Node breaking change.
2 parents b2e7b46 + f9a28ed commit 7c0f559

File tree

5 files changed

+25
-27
lines changed

5 files changed

+25
-27
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ defaults:
55

66
env:
77
PROTOC_VERSION: 3.x
8-
DEFAULT_NODE_VERSION: 18.x # If changing this, also change jobs.tests.strategy.matrix.node_version
98

109
on:
1110
push:
@@ -19,10 +18,10 @@ jobs:
1918
runs-on: ubuntu-latest
2019

2120
steps:
22-
- uses: actions/checkout@v2
23-
- uses: actions/setup-node@v2
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-node@v3
2423
with:
25-
node-version: ${{ env.DEFAULT_NODE_VERSION }}
24+
node-version: 'lts/*'
2625
check-latest: true
2726

2827
- name: Check out the language repo
@@ -43,12 +42,12 @@ jobs:
4342
strategy:
4443
matrix:
4544
os: [ubuntu, macos, windows]
46-
node-version: [18.x, 16.x, 14.x] # If changing this, also change env.DEFAULT_NODE_VERSION
45+
node-version: ['lts/*', 'lts/-1', 'lts/-2']
4746
fail-fast: false
4847

4948
steps:
50-
- uses: actions/checkout@v2
51-
- uses: actions/setup-node@v2
49+
- uses: actions/checkout@v3
50+
- uses: actions/setup-node@v3
5251
with:
5352
node-version: ${{ matrix.node-version }}
5453
check-latest: true
@@ -73,9 +72,6 @@ jobs:
7372
- run: npm run compile
7473
- run: node test/after-compile-test.mjs
7574

76-
# The versions should be kept up-to-date with the latest LTS Node releases.
77-
# They next need to be rotated October 2021. See
78-
# https://github.com/nodejs/Release.
7975
sass_spec:
8076
name: 'JS API Tests | Node ${{ matrix.node_version }} | ${{ matrix.os }}'
8177
runs-on: ${{ matrix.os }}-latest
@@ -84,19 +80,19 @@ jobs:
8480
fail-fast: false
8581
matrix:
8682
os: [ubuntu, windows, macos]
87-
node_version: [18]
83+
node_version: ['lts/*']
8884
include:
8985
# Include LTS versions on Ubuntu
9086
- os: ubuntu
91-
node_version: 16
87+
node_version: lts/-1
9288
- os: ubuntu
93-
node_version: 14
89+
node_version: lts/-2
9490

9591
steps:
96-
- uses: actions/checkout@v2
92+
- uses: actions/checkout@v3
9793
- uses: dart-lang/setup-dart@v1
9894
with: {sdk: stable}
99-
- uses: actions/setup-node@v2
95+
- uses: actions/setup-node@v3
10096
with: {node-version: "${{ matrix.node_version }}"}
10197

10298
- name: Check out Dart Sass
@@ -144,10 +140,10 @@ jobs:
144140
needs: [static_analysis, tests, sass_spec]
145141

146142
steps:
147-
- uses: actions/checkout@v2
148-
- uses: actions/setup-node@v2
143+
- uses: actions/checkout@v3
144+
- uses: actions/setup-node@v3
149145
with:
150-
node-version: ${{ env.DEFAULT_NODE_VERSION }}
146+
node-version: 'lts/*'
151147
check-latest: true
152148
registry-url: 'https://registry.npmjs.org'
153149
- run: npm install

lib/index.mjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export const compileAsync = sass.compileAsync;
55
export const compileString = sass.compileString;
66
export const compileStringAsync = sass.compileStringAsync;
77
export const Logger = sass.Logger;
8-
export const CalculationInterpolation = sass.CalculationInterpolation
9-
export const CalculationOperation = sass.CalculationOperation
10-
export const CalculationOperator = sass.CalculationOperator
8+
export const CalculationInterpolation = sass.CalculationInterpolation;
9+
export const CalculationOperation = sass.CalculationOperation;
10+
export const CalculationOperator = sass.CalculationOperator;
1111
export const SassArgumentList = sass.SassArgumentList;
1212
export const SassBoolean = sass.SassBoolean;
13-
export const SassCalculation = sass.SassCalculation
13+
export const SassCalculation = sass.SassCalculation;
1414
export const SassColor = sass.SassColor;
1515
export const SassFunction = sass.SassFunction;
1616
export const SassMixin = sass.SassMixin;
@@ -39,8 +39,9 @@ function defaultExportDeprecation() {
3939
if (printedDefaultExportDeprecation) return;
4040
printedDefaultExportDeprecation = true;
4141
console.error(
42-
"`import sass from 'sass'` is deprecated.\n" +
43-
"Please use `import * as sass from 'sass'` instead.");
42+
"`import sass from 'sass'` is deprecated.\n" +
43+
"Please use `import * as sass from 'sass'` instead."
44+
);
4445
}
4546

4647
export default {

lib/src/utils.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ describe('utils', () => {
55
describe('pathToUrlString', () => {
66
it('encode relative path like `pathToFileURL`', () => {
77
const baseURL = pathToFileURL('').toString();
8-
for (let i = 0; i < 128; i++) {
8+
// Skip charcodes 0-32 to work around Node trailing whitespace regression:
9+
// https://github.com/nodejs/node/issues/51167
10+
for (let i = 33; i < 128; i++) {
911
const char = String.fromCharCode(i);
1012
const filename = `${i}-${char}`;
1113
expect(pathToUrlString(filename)).toEqual(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dist/**/*"
2222
],
2323
"engines": {
24-
"node": ">=14.0.0"
24+
"node": ">=16.0.0"
2525
},
2626
"scripts": {
2727
"init": "ts-node ./tool/init.ts",

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"resolveJsonModule": true,
77
"rootDir": ".",
88
"useUnknownInCatchVariables": false,
9-
"resolveJsonModule": true,
109
"declaration": false,
1110
"lib": ["DOM"]
1211
},

0 commit comments

Comments
 (0)