Skip to content

Commit b964fb1

Browse files
committed
resolve conflicts
2 parents fc0d956 + 80c9ec4 commit b964fb1

423 files changed

Lines changed: 52360 additions & 47718 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
const path = require('node:path');
2+
3+
const MAX_LINE_LENGTH = 120;
4+
5+
module.exports = {
6+
parser: '@typescript-eslint/parser',
7+
ignorePatterns: ['tests/smoke/**'],
8+
env: {
9+
browser: true,
10+
qunit: true,
11+
},
12+
extends: [
13+
'airbnb-base',
14+
'plugin:jsdoc/recommended',
15+
],
16+
plugins: [
17+
'import',
18+
'import-newlines',
19+
],
20+
settings: {
21+
'import/resolver': {
22+
typescript: {
23+
alwaysTryTypes: true,
24+
project: 'tsconfig.json',
25+
},
26+
},
27+
},
28+
rules: {
29+
indent: ['error', 4, {
30+
SwitchCase: 1,
31+
}],
32+
'no-underscore-dangle': ['error', {
33+
allow: ['__filename', '__dirname'],
34+
}],
35+
'import/extensions': ['error', 'never', { json: 'always' }],
36+
'no-param-reassign': 0,
37+
'no-shadow': 0,
38+
'no-bitwise': 0,
39+
'no-new': 0,
40+
'function-call-argument-newline': [
41+
'error',
42+
'consistent',
43+
],
44+
'import/prefer-default-export': 0,
45+
'no-continue': 0,
46+
'no-await-in-loop': 0,
47+
'max-len': ['error', { code: MAX_LINE_LENGTH, ignoreUrls: true }],
48+
'arrow-body-style': 0,
49+
'import/no-extraneous-dependencies': 'off',
50+
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
51+
'no-constant-condition': ['error', { checkLoops: false }],
52+
// jsdoc rules
53+
'jsdoc/check-param-names': 'error',
54+
'jsdoc/check-tag-names': ['error', {
55+
definedTags: [
56+
'scriptlet',
57+
'trustedScriptlet',
58+
'redirect',
59+
'added',
60+
'jest-environment',
61+
],
62+
}],
63+
'jsdoc/tag-lines': 'off',
64+
'jsdoc/require-jsdoc': 0,
65+
'jsdoc/require-param': 0,
66+
'jsdoc/require-param-description': 0,
67+
'jsdoc/require-returns': 'off',
68+
'jsdoc/require-returns-description': 0,
69+
'jsdoc/no-defaults': 0,
70+
'import-newlines/enforce': ['error', { items: 3, 'max-len': MAX_LINE_LENGTH }],
71+
// Split external and internal imports with an empty line
72+
'import/order': [
73+
'error',
74+
{
75+
groups: [
76+
['builtin', 'external'],
77+
],
78+
'newlines-between': 'always',
79+
},
80+
],
81+
// Force proper import and export of types
82+
'@typescript-eslint/consistent-type-imports': [
83+
'error',
84+
{
85+
fixStyle: 'inline-type-imports',
86+
},
87+
],
88+
},
89+
overrides: [
90+
{
91+
files: ['**/*.ts'],
92+
parser: '@typescript-eslint/parser',
93+
parserOptions: {
94+
tsconfigRootDir: path.join(__dirname),
95+
project: 'tsconfig.json',
96+
},
97+
extends: [
98+
'airbnb-typescript/base',
99+
],
100+
rules: {
101+
'jsdoc/require-param-type': 0,
102+
'jsdoc/require-returns-type': 0,
103+
'@typescript-eslint/ban-ts-comment': 0,
104+
'@typescript-eslint/member-delimiter-style': [
105+
'error',
106+
{
107+
multiline: {
108+
delimiter: 'semi',
109+
requireLast: true,
110+
},
111+
singleline: {
112+
delimiter: 'semi',
113+
requireLast: false,
114+
},
115+
},
116+
],
117+
'@typescript-eslint/no-explicit-any': 0,
118+
'@typescript-eslint/indent': ['error', 4],
119+
'@typescript-eslint/interface-name-prefix': 0,
120+
'@typescript-eslint/no-non-null-assertion': 0,
121+
'import/no-extraneous-dependencies': 'off',
122+
'@typescript-eslint/type-annotation-spacing': [
123+
'error',
124+
{
125+
after: true,
126+
},
127+
],
128+
'prefer-object-spread': 0,
129+
},
130+
},
131+
// Array destructuring is not allowed according to the
132+
// ReferenceError: _slicedToArray is not defined
133+
{
134+
files: ['src/**/*.{js,ts}'],
135+
rules: {
136+
'prefer-destructuring': [
137+
'error',
138+
{
139+
array: false,
140+
},
141+
],
142+
'no-restricted-syntax': [
143+
'error',
144+
'ArrayPattern',
145+
],
146+
},
147+
},
148+
],
149+
};

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Github Release
2+
3+
env:
4+
NODE_VERSION: 22
5+
PNPM_VERSION: 10.7.1
6+
7+
# Workflow need write access to the repository to create a GitHub release
8+
permissions:
9+
contents: write
10+
11+
on:
12+
push:
13+
tags:
14+
- v*
15+
# Make possible to run manually
16+
workflow_dispatch:
17+
inputs:
18+
# warn before running manually
19+
warning:
20+
description: 'Should be run only for tags like `v*`'
21+
required: false
22+
type: boolean
23+
24+
# Make sure that only one release workflow runs at a time.
25+
concurrency:
26+
group: release
27+
28+
jobs:
29+
release:
30+
name: Create GitHub release
31+
runs-on: ubuntu-latest
32+
# Only run this job for v* tags
33+
if: startsWith(github.ref, 'refs/tags/v')
34+
steps:
35+
- name: Check out the repository
36+
uses: actions/checkout@v4
37+
38+
- name: Setup pnpm
39+
uses: pnpm/action-setup@v4
40+
with:
41+
version: ${{ env.PNPM_VERSION }}
42+
run_install: false
43+
44+
- name: Set up Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: ${{ env.NODE_VERSION }}
48+
registry-url: https://registry.npmjs.org
49+
cache: pnpm
50+
51+
- name: Install dependencies
52+
run: pnpm install
53+
54+
- name: Run ESLint
55+
run: pnpm lint
56+
57+
- name: Run tests
58+
run: pnpm test
59+
60+
- name: Run build
61+
run: pnpm build
62+
63+
- name: Release on GitHub
64+
uses: softprops/action-gh-release@v1
65+
with:
66+
draft: false
67+
prerelease: false
68+
body: See [CHANGELOG.md](../master/CHANGELOG.md) for the list of changes.
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
72+
notify:
73+
name: Send Slack notification
74+
needs: release
75+
# Note: 'always()' is needed to run the notify job even if the test job was failed
76+
if:
77+
${{
78+
always() &&
79+
github.repository == 'AdguardTeam/Scriptlets' &&
80+
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
81+
}}
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Send Slack notification
85+
uses: 8398a7/action-slack@v3
86+
with:
87+
status: ${{ needs.release.result }}
88+
fields: workflow, repo, message, commit, author, eventName, ref, job
89+
job_name: release
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/test.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test Scriptlets
2+
3+
env:
4+
NODE_VERSION: 22
5+
PNPM_VERSION: 10.7.1
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
tags:
12+
- "v*.*.*"
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: ${{ env.PNPM_VERSION }}
25+
run_install: false
26+
27+
- name: Use Node.jobs
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ env.NODE_VERSION }}
31+
32+
- name: pnpm install
33+
run: pnpm install
34+
35+
- name: pnpm lint
36+
run: pnpm lint
37+
38+
- name: pnpm test
39+
run: pnpm test
40+
41+
- name: pnpm build
42+
run: pnpm build
43+
44+
notify:
45+
name: Send Slack notification on failure
46+
needs: build
47+
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/Scriptlets' repository
48+
# Note: 'always()' is needed to run the notify job even if the test job was failed
49+
if:
50+
${{
51+
always() &&
52+
needs.check_code.result == 'failure' &&
53+
github.repository == 'AdguardTeam/Scriptlets' &&
54+
(
55+
github.event_name == 'push' ||
56+
github.event_name == 'workflow_dispatch' ||
57+
github.event.pull_request.head.repo.full_name == github.repository
58+
)
59+
}}
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Send Slack notification
63+
uses: 8398a7/action-slack@v3
64+
with:
65+
status: failure
66+
fields: workflow, repo, message, commit, author, eventName, ref, job
67+
job_name: check_code
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/workflow.yaml

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)