Skip to content

Commit c5a1df6

Browse files
authored
Merge pull request #81 from phanect/ci-prepare-upgrades
[BREAKING] Maintenance for CI to prepare for Node.js & ESLint upgrade on next major release of this plugin
2 parents 6a4b801 + 1595391 commit c5a1df6

File tree

4 files changed

+40
-39
lines changed

4 files changed

+40
-39
lines changed

.github/workflows/actions.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
name: GitHub Actions
22

33
on:
4+
schedule:
5+
- cron: "8 11 * * 5" # At 11:08 on Friday
46
pull_request:
57
branches:
68
- main
7-
types:
8-
- opened
9-
- edited
10-
- reopened
11-
- synchronize
129
push:
1310
branches:
1411
- main
@@ -23,11 +20,13 @@ jobs:
2320
strategy:
2421
matrix:
2522
node-version:
26-
- 14
27-
- 16
2823
- 18
2924
- 20
30-
- 21
25+
- 22
26+
eslint-version:
27+
- 8
28+
env:
29+
ESLINT_VERSION: ${{ matrix.eslint-version }}
3130

3231
steps:
3332
- uses: actions/checkout@v3
@@ -53,7 +52,7 @@ jobs:
5352
- uses: actions/checkout@v3
5453
- uses: actions/setup-node@v3
5554
with:
56-
node-version: 18
55+
node-version: 20
5756

5857
- run: npm install # not `npm ci` since there is no package-lock.json in this project
5958

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.circleci/
1+
.github/
22
.editorconfig
33
.eslintrc.js
44
node_modules/

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
An ESLint plugin to enforce EditorConfig rules
44

5-
[![CircleCI](https://circleci.com/gh/phanect/eslint-plugin-editorconfig.svg?style=svg)](https://circleci.com/gh/phanect/eslint-plugin-editorconfig) [![NPM Version](https://img.shields.io/npm/v/eslint-plugin-editorconfig.svg)](https://npmjs.org/package/eslint-plugin-editorconfig)
5+
[![GitHub Actions Status](https://github.com/phanect/eslint-plugin-editorconfig/actions/workflows/actions.yml/badge.svg)](https://github.com/phanect/eslint-plugin-editorconfig/actions/workflows/actions.yml) [![NPM Version](https://img.shields.io/npm/v/eslint-plugin-editorconfig.svg)](https://npmjs.org/package/eslint-plugin-editorconfig)
66

77
## Requirements
88

99
- ESLint v8
1010
- ESLint v9 and flat config support is not ready yet. Even if you use legacy .eslintrc.\*, it does not work on v9. Sorry! :pray:
11-
- Node.js v{16, 18, 20}
12-
- While not officially supported, also tested on v14 and v21. v14 support will be dropped on next major release. v21 support will be dropped when it reaches EOL and without major update of eslint-plugin-editorconfig.
11+
- Node.js v{18, 20, 22}
1312

1413
## Install
1514

test-packages/test.sh

+29-26
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ TEST_PKGS_DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
66
PROJECT_ROOT="$(realpath "${TEST_PKGS_DIR}/..")"
77
TMP="$(mktemp --directory)"
88

9+
# To run tests on local machine
10+
if [[ -z "${ESLINT_VERSION:-}" ]]; then
11+
ESLINT_VERSION=8
12+
fi
13+
914
cd "${PROJECT_ROOT}"
1015
PACKAGE="$(npm pack .)"
1116

@@ -15,31 +20,29 @@ git clean -Xd --force
1520
# If you test without copying, test package is affected by node_modules in the project root
1621
cp --recursive "${TEST_PKGS_DIR}" "${TMP}/"
1722

18-
for ESLINT_VERSION in "7" "8"; do
19-
for PKGDIR in $(find "${TMP}/test-packages/success/" -maxdepth 1 -type d ! -path "${TMP}/test-packages/success/"); do
20-
cd "${PKGDIR}"
21-
npm install
22-
npm install --save-dev "eslint@${ESLINT_VERSION}" "${PROJECT_ROOT}/${PACKAGE}"
23-
npm run lint
24-
done
25-
26-
for PKGDIR in $(find "${TMP}/test-packages/failure/" -maxdepth 1 -type d ! -path "${TMP}/test-packages/failure/"); do
27-
cd "${PKGDIR}"
28-
npm install
29-
npm install --save-dev "eslint@${ESLINT_VERSION}" "${PROJECT_ROOT}/${PACKAGE}"
30-
31-
if [[ "${PKGDIR}" = "${TMP}/test-packages/failure/missing-ts-eslint" ]]; then
32-
# skip if Node.js version == 14.x
33-
if [[ -n "$(node --version | grep '^v14\.')" ]]; then
34-
continue
35-
fi
36-
37-
if [[ -z "$((npm run lint 2>&1) | grep "eslint-plugin-editorconfig requires typescript and @typescript-eslint/eslint-plugin to lint \*.ts files. Run \`npm install typescript @typescript-eslint/eslint-plugin\`.")" ]]; then
38-
echo "Error message is not shown properly when @typescript-eslint/eslint-plugin is missing" >&2
39-
echo "ESLint's error message:"
40-
npm run lint
41-
exit 1
42-
fi
23+
for PKGDIR in $(find "${TMP}/test-packages/success/" -maxdepth 1 -type d ! -path "${TMP}/test-packages/success/"); do
24+
cd "${PKGDIR}"
25+
npm install
26+
npm install --save-dev "eslint@${ESLINT_VERSION}" "${PROJECT_ROOT}/${PACKAGE}"
27+
npm run lint
28+
done
29+
30+
for PKGDIR in $(find "${TMP}/test-packages/failure/" -maxdepth 1 -type d ! -path "${TMP}/test-packages/failure/"); do
31+
cd "${PKGDIR}"
32+
npm install
33+
npm install --save-dev "eslint@${ESLINT_VERSION}" "${PROJECT_ROOT}/${PACKAGE}"
34+
35+
if [[ "${PKGDIR}" = "${TMP}/test-packages/failure/missing-ts-eslint" ]]; then
36+
# skip if Node.js version == 14.x
37+
if [[ -n "$(node --version | grep '^v14\.')" ]]; then
38+
continue
39+
fi
40+
41+
if [[ -z "$((npm run lint 2>&1) | grep "eslint-plugin-editorconfig requires typescript and @typescript-eslint/eslint-plugin to lint \*.ts files. Run \`npm install typescript @typescript-eslint/eslint-plugin\`.")" ]]; then
42+
echo "Error message is not shown properly when @typescript-eslint/eslint-plugin is missing" >&2
43+
echo "ESLint's error message:"
44+
npm run lint
45+
exit 1
4346
fi
44-
done
47+
fi
4548
done

0 commit comments

Comments
 (0)