From c24515740da479bb9108b63166aec5b301b7789d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wr=C3=B3blewski?= Date: Fri, 20 Sep 2024 22:57:45 +0300 Subject: [PATCH] AG-36175 Add ext_chromium_mv3 to known platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge in ADGUARD-FILTERS/aglint from fix/AG-36175 to master Squashed commit of the following: commit 065bef847fc8ee4a3adac582cea8422cbd390640 Author: Slava Leleka Date: Fri Sep 20 22:54:16 2024 +0300 update changelog commit be8e5a6a9db4994c52a2cfa1eec95b6a9d70e224 Author: Slava Leleka Date: Fri Sep 20 22:51:24 2024 +0300 bump version, update changelog commit aec0824f97b97f5b8cb1b1722f3784b463c59d9e Author: Adam Wróblewski Date: Fri Sep 20 21:43:50 2024 +0200 Add ext_chromium_mv3 to known platforms --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- src/linter/rules/unknown-hints-and-platforms.ts | 1 + test/linter/rules/unknown-hints-and-platforms.test.ts | 6 ++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd3795..198ad06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,15 @@ The format is based on [Keep a Changelog][keepachangelog], and this project adhe [keepachangelog]: https://keepachangelog.com/en/1.0.0/ [semver]: https://semver.org/spec/v2.0.0.html +## [2.1.1] - 2024-09-20 + +### Added + +- Support of `ext_chromium_mv3` as a known platform for `PLATFORM` and `NOT_PLATFORM` hints [#220]. + +[2.1.1]: https://github.com/AdguardTeam/AGLint/compare/v2.1.0...v2.1.1 +[#220]: https://github.com/AdguardTeam/AGLint/issues/220 + ## [2.1.0] - 2024-09-11 ### Added diff --git a/package.json b/package.json index 65f0ae0..9a7b72f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adguard/aglint", - "version": "2.1.0", + "version": "2.1.1", "description": "Universal adblock filter list linter.", "keywords": [ "adblock", diff --git a/src/linter/rules/unknown-hints-and-platforms.ts b/src/linter/rules/unknown-hints-and-platforms.ts index a924b43..730fdb5 100644 --- a/src/linter/rules/unknown-hints-and-platforms.ts +++ b/src/linter/rules/unknown-hints-and-platforms.ts @@ -20,6 +20,7 @@ const KNOWN_PLATFORMS = new Set([ 'mac', 'android', 'ios', + 'ext_chromium_mv3', 'ext_chromium', 'ext_ff', 'ext_edge', diff --git a/test/linter/rules/unknown-hints-and-platforms.test.ts b/test/linter/rules/unknown-hints-and-platforms.test.ts index eb8c1ad..51f9bbd 100644 --- a/test/linter/rules/unknown-hints-and-platforms.test.ts +++ b/test/linter/rules/unknown-hints-and-platforms.test.ts @@ -19,6 +19,7 @@ describe('unknown-hints-and-platforms', () => { expect(linter.lint('!+ PLATFORM(mac)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ PLATFORM(android)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ PLATFORM(ios)')).toMatchObject({ problems: [] }); + expect(linter.lint('!+ PLATFORM(ext_chromium_mv3)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ PLATFORM(ext_chromium)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ PLATFORM(ext_ff)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ PLATFORM(ext_edge)')).toMatchObject({ problems: [] }); @@ -31,7 +32,7 @@ describe('unknown-hints-and-platforms', () => { expect( linter.lint( // eslint-disable-next-line max-len - '!+ PLATFORM(windows, mac, android, ios, ext_chromium, ext_ff, ext_edge, ext_opera, ext_safari, ext_android_cb, ext_ublock)', + '!+ PLATFORM(windows, mac, android, ios, ext_chromium_mv3, ext_chromium, ext_ff, ext_edge, ext_opera, ext_safari, ext_android_cb, ext_ublock)', ), ).toMatchObject({ problems: [] }); @@ -40,6 +41,7 @@ describe('unknown-hints-and-platforms', () => { expect(linter.lint('!+ NOT_PLATFORM(mac)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ NOT_PLATFORM(android)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ NOT_PLATFORM(ios)')).toMatchObject({ problems: [] }); + expect(linter.lint('!+ NOT_PLATFORM(ext_chromium_mv3)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ NOT_PLATFORM(ext_chromium)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ NOT_PLATFORM(ext_ff)')).toMatchObject({ problems: [] }); expect(linter.lint('!+ NOT_PLATFORM(ext_edge)')).toMatchObject({ problems: [] }); @@ -52,7 +54,7 @@ describe('unknown-hints-and-platforms', () => { expect( linter.lint( // eslint-disable-next-line max-len - '!+ NOT_PLATFORM(windows, mac, android, ios, ext_chromium, ext_ff, ext_edge, ext_opera, ext_safari, ext_android_cb, ext_ublock)', + '!+ NOT_PLATFORM(windows, mac, android, ios, ext_chromium_mv3, ext_chromium, ext_ff, ext_edge, ext_opera, ext_safari, ext_android_cb, ext_ublock)', ), ).toMatchObject({ problems: [] }); });