Skip to content

Commit 01ccad3

Browse files
Merge pull request #315 from humanmade/upgrade-eslint
Upgrade eslint and stylelint
2 parents 331324c + 142b375 commit 01ccad3

19 files changed

Lines changed: 10852 additions & 15316 deletions

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.travis.yml

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,29 @@ branches:
1414
jobs:
1515
include:
1616
- language: php
17-
php: 7.2
18-
install:
19-
- composer install
20-
script:
21-
- vendor/bin/phpunit
22-
- language: php
23-
php: 7.3
24-
install:
25-
- composer install
26-
script:
27-
- vendor/bin/phpunit
28-
- language: php
29-
php: 7.4
17+
php: 8.1
3018
install:
31-
- composer install
19+
# For PHP 8.0+, we need to ignore platform reqs as PHPUnit 7 is still used.
20+
- composer install --ignore-platform-reqs
3221
script:
33-
- vendor/bin/phpunit
22+
# For PHP 8.1+, we need to ignore the config file so that PHPUnit 7 doesn't try to read it and cause an error.
23+
# Instead, we pass all required settings as part of the phpunit command.
24+
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/AllSniffs.php
25+
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/FixtureTests.php
26+
3427
- language: php
35-
php: 8.0
28+
php: 8.2
3629
install:
3730
# For PHP 8.0+, we need to ignore platform reqs as PHPUnit 7 is still used.
3831
- composer install --ignore-platform-reqs
3932
script:
40-
- vendor/bin/phpunit
33+
# For PHP 8.1+, we need to ignore the config file so that PHPUnit 7 doesn't try to read it and cause an error.
34+
# Instead, we pass all required settings as part of the phpunit command.
35+
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/AllSniffs.php
36+
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/FixtureTests.php
37+
4138
- language: php
42-
php: 8.1
39+
php: 8.3
4340
install:
4441
# For PHP 8.0+, we need to ignore platform reqs as PHPUnit 7 is still used.
4542
- composer install --ignore-platform-reqs
@@ -48,21 +45,63 @@ jobs:
4845
# Instead, we pass all required settings as part of the phpunit command.
4946
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/AllSniffs.php
5047
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/FixtureTests.php
48+
49+
- language: node_js
50+
node_js: 20
51+
install:
52+
- npm ci
53+
- cd packages/eslint-config-humanmade
54+
- npm ci
55+
- cd ../..
56+
script:
57+
- npm run test:eslint
58+
5159
- language: node_js
52-
node_js: 16
60+
node_js: 20
5361
install:
54-
- npm install
62+
- npm ci
63+
- cd packages/stylelint-config
64+
- npm ci
65+
- cd ../..
66+
script:
67+
- npm run test:stylelint
68+
69+
- language: node_js
70+
node_js: 22
71+
install:
72+
- npm ci
5573
- cd packages/eslint-config-humanmade
56-
- npm install --legacy-peer-deps
74+
- npm ci
5775
- cd ../..
5876
script:
5977
- npm run test:eslint
78+
79+
- language: node_js
80+
node_js: 22
81+
install:
82+
- npm ci
83+
- cd packages/stylelint-config
84+
- npm ci
85+
- cd ../..
86+
script:
87+
- npm run test:stylelint
88+
89+
- language: node_js
90+
node_js: 24
91+
install:
92+
- npm ci
93+
- cd packages/eslint-config-humanmade
94+
- npm ci
95+
- cd ../..
96+
script:
97+
- npm run test:eslint
98+
6099
- language: node_js
61-
node_js: 16
100+
node_js: 24
62101
install:
63-
- npm install
102+
- npm ci
64103
- cd packages/stylelint-config
65-
- npm install
104+
- npm ci
66105
- cd ../..
67106
script:
68107
- npm run test:stylelint

HM/Sniffs/Debug/ESLintSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ class ESLintSniff implements Sniff {
1818
/**
1919
* A list of tokenizers this sniff supports.
2020
*
21+
* Note: Disabled due to PHP_CodeSniffer 4.0 deprecation of CSS/JS scanning.
2122
* @var array
2223
*/
23-
public $supportedTokenizers = [ 'JS' ];
24+
public $supportedTokenizers = [];
2425

2526
/**
2627
* ESLint configuration file path.

0 commit comments

Comments
 (0)