Skip to content

Commit

Permalink
Merge branch 'master' into task/0-update-match-invalid-selector-regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 authored Feb 25, 2024
2 parents dceef11 + f522225 commit 50976ce
Show file tree
Hide file tree
Showing 135 changed files with 4,285 additions and 5,565 deletions.
File renamed without changes.
249 changes: 118 additions & 131 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,186 +1,173 @@
const WARN = "warn";
const ERROR = "error";
const OFF = "off";
const WARN = 'warn';
const ERROR = 'error';
const OFF = 'off';

const COMMON_CONFIG = {
plugins: ["jsdoc", "filenames", "import", "prettier"],
extends: ["prettier", "plugin:prettier/recommended"],
plugins: ['jsdoc', 'filenames', 'import', 'prettier'],
extends: ['prettier', 'plugin:prettier/recommended'],
rules: {
"prettier/prettier": WARN,
"no-underscore-dangle": OFF,
"no-debugger": WARN,
"space-infix-ops": ERROR,
"no-console": WARN,
"wrap-iife": OFF,
"no-self-assign": ERROR,
"no-self-compare": ERROR,
"no-loop-func": OFF,
"array-callback-return": ERROR,
'prettier/prettier': WARN,
'no-underscore-dangle': OFF,
'no-debugger': WARN,
'space-infix-ops': ERROR,
'no-console': WARN,
'wrap-iife': OFF,
'no-self-assign': ERROR,
'no-self-compare': ERROR,
'no-loop-func': OFF,
'array-callback-return': ERROR,
curly: ERROR,
"no-fallthrough": OFF,
"dot-notation": OFF,
"prefer-const": WARN,
"no-empty-function": OFF,
"no-with": ERROR,
"one-var": [ERROR, "never"],
camelcase: [WARN, { properties: "always", ignoreImports: true }],
"spaced-comment": [WARN, "always"],
"capitalized-comments": [WARN, "always", { ignorePattern: "prettier" }],
"no-useless-rename": WARN,
"jsdoc/check-alignment": WARN,
"jsdoc/check-examples": OFF,
"jsdoc/check-indentation": WARN,
"jsdoc/check-syntax": WARN,
"jsdoc/check-tag-names": WARN,
"jsdoc/check-types": WARN,
"jsdoc/implements-on-classes": WARN,
"jsdoc/match-description": OFF,
"jsdoc/newline-after-description": WARN,
"jsdoc/no-types": OFF,
"jsdoc/no-undefined-types": OFF,
"jsdoc/require-description": OFF,
"jsdoc/require-description-complete-sentence": OFF,
"jsdoc/require-example": OFF,
"jsdoc/require-hyphen-before-param-description": [WARN, "never"],
"jsdoc/require-param": WARN,
"jsdoc/require-param-name": WARN,
"jsdoc/require-returns-check": WARN,
"jsdoc/require-returns-description": WARN,
"jsdoc/valid-types": WARN,
"filenames/match-exported": WARN,
"no-useless-constructor": WARN,
"jsdoc/require-jsdoc": [
'no-fallthrough': OFF,
'dot-notation': OFF,
'prefer-const': WARN,
'no-empty-function': OFF,
'no-with': ERROR,
'one-var': [ERROR, 'never'],
camelcase: [WARN, { properties: 'always', ignoreImports: true }],
'spaced-comment': [WARN, 'always'],
'capitalized-comments': OFF,
'no-useless-rename': WARN,
'jsdoc/check-alignment': WARN,
'jsdoc/check-examples': OFF,
'jsdoc/check-indentation': WARN,
'jsdoc/check-syntax': WARN,
'jsdoc/check-tag-names': WARN,
'jsdoc/check-types': WARN,
'jsdoc/implements-on-classes': WARN,
'jsdoc/match-description': OFF,
'jsdoc/newline-after-description': OFF,
'jsdoc/no-types': OFF,
'jsdoc/no-undefined-types': OFF,
'jsdoc/require-description': OFF,
'jsdoc/require-description-complete-sentence': OFF,
'jsdoc/require-example': OFF,
'jsdoc/require-hyphen-before-param-description': [WARN, 'never'],
'jsdoc/require-param': WARN,
'jsdoc/require-param-name': WARN,
'jsdoc/require-returns-check': WARN,
'jsdoc/require-returns-description': WARN,
'jsdoc/valid-types': WARN,
'filenames/match-exported': WARN,
'no-useless-constructor': WARN,
'jsdoc/require-jsdoc': [
WARN,
{
require: {
ArrowFunctionExpression: false,
FunctionDeclaration: false,
FunctionExpression: false,
ClassDeclaration: true,
MethodDefinition: true,
},
},
MethodDefinition: true
}
}
],
"import/no-extraneous-dependencies": WARN,
},
'import/no-extraneous-dependencies': WARN
}
};

const TS_PARSER_FIELDS = {
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: "module",
},
sourceType: 'module'
}
};

module.exports = {
env: {
es6: true,
browser: true,
node: true,
node: true
},
parserOptions: {
ecmaVersion: 2020
},
overrides: [
{
files: ["*.js", "*.jsx", "*.mjs"],
files: ['*.js', '*.jsx', '*.mjs', '*.cjs'],
...TS_PARSER_FIELDS,
plugins: COMMON_CONFIG.plugins,
extends: COMMON_CONFIG.extends,
rules: {
...COMMON_CONFIG.rules,
"no-undef": ERROR,
"jsdoc/check-param-names": WARN,
"jsdoc/require-param-type": WARN,
"jsdoc/require-returns": WARN,
"jsdoc/require-param-description": WARN,
"jsdoc/require-returns-type": WARN,
"consistent-return": WARN,
},
'no-undef': ERROR,
'jsdoc/check-param-names': WARN,
'jsdoc/require-param-type': WARN,
'jsdoc/require-returns': WARN,
'jsdoc/require-param-description': WARN,
'jsdoc/require-returns-type': WARN,
'consistent-return': WARN
}
},
{
files: ["*.json"],
plugins: ["json"],
extends: ["eslint:recommended", "plugin:json/recommended"],
files: ['*.json'],
plugins: ['json'],
extends: ['eslint:recommended', 'plugin:json/recommended']
},
{
files: ["*.ts", "*.tsx"],
plugins: [...COMMON_CONFIG.plugins, "@typescript-eslint"],
files: ['*.ts', '*.tsx'],
plugins: [...COMMON_CONFIG.plugins, '@typescript-eslint'],
...TS_PARSER_FIELDS,
extends: [
...COMMON_CONFIG.extends,
"plugin:@typescript-eslint/recommended",
],
extends: [...COMMON_CONFIG.extends, 'plugin:@typescript-eslint/recommended'],
rules: {
...COMMON_CONFIG.rules,
"@typescript-eslint/explicit-member-accessibility": [
'@typescript-eslint/explicit-member-accessibility': [
ERROR,
{ overrides: { constructors: "no-public" } },
{ overrides: { constructors: 'no-public' } }
],
"@typescript-eslint/no-unused-vars": OFF, // TSC is already doing this
"@typescript-eslint/ban-types": OFF, // TSC is already doing this
"no-undef": OFF, // TSC is already doing this
"@typescript-eslint/no-var-requires": OFF,
"@typescript-eslint/explicit-module-boundary-types": OFF, // TSC is already doing this
"@typescript-eslint/consistent-type-assertions": [
'@typescript-eslint/no-unused-vars': OFF, // TSC is already doing this
'@typescript-eslint/ban-types': OFF, // TSC is already doing this
'no-undef': OFF, // TSC is already doing this
'@typescript-eslint/no-var-requires': OFF,
'@typescript-eslint/explicit-module-boundary-types': OFF, // TSC is already doing this
'@typescript-eslint/consistent-type-assertions': [
WARN,
{ assertionStyle: "angle-bracket" },
{ assertionStyle: 'angle-bracket' }
],
"@typescript-eslint/no-explicit-any": OFF,
"@typescript-eslint/no-empty-function": OFF,
"@typescript-eslint/no-use-before-define": OFF,
"@typescript-eslint/no-this-alias": OFF,
"@typescript-eslint/explicit-function-return-type": [
ERROR,
{ allowExpressions: true },
],
"@typescript-eslint/member-ordering": [
'@typescript-eslint/no-explicit-any': OFF,
'@typescript-eslint/no-empty-function': OFF,
'@typescript-eslint/no-use-before-define': OFF,
'@typescript-eslint/no-this-alias': OFF,
'@typescript-eslint/explicit-function-return-type': [ERROR, { allowExpressions: true }],
'@typescript-eslint/member-ordering': [
WARN,
{
default: [
"signature",
"field",
"constructor",
["get", "set"],
"method",
],
},
default: ['signature', 'field', 'constructor', ['get', 'set'], 'method']
}
],
"@typescript-eslint/ban-ts-comment": OFF,
"jsdoc/no-types": WARN,
"import/named": OFF,
"import/no-named-as-default": WARN,
"import/no-extraneous-dependencies": WARN,
"import/no-absolute-path": WARN,
"@typescript-eslint/naming-convention": [
'@typescript-eslint/ban-ts-comment': OFF,
'jsdoc/no-types': WARN,
'import/named': OFF,
'import/no-named-as-default': WARN,
'import/no-extraneous-dependencies': WARN,
'import/no-absolute-path': WARN,
'@typescript-eslint/naming-convention': [
WARN,
{
selector: "interface",
format: ["PascalCase"],
prefix: ["I"],
selector: 'interface',
format: ['PascalCase'],
prefix: ['I']
},
{
selector: "enum",
format: ["PascalCase"],
suffix: ["Enum"],
selector: 'enum',
format: ['PascalCase'],
suffix: ['Enum']
},
{
selector: "typeParameter",
format: ["PascalCase"],
selector: 'typeParameter',
format: ['PascalCase']
},
{
selector: "memberLike",
modifiers: ["private"],
leadingUnderscore: "allow",
format: ["camelCase"],
selector: 'memberLike',
modifiers: ['private'],
leadingUnderscore: 'allow',
format: ['camelCase']
},
{
selector: "class",
format: ["PascalCase"],
},
],
},
},
],
selector: 'class',
format: ['PascalCase']
}
]
}
}
]
};
19 changes: 19 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Auto Assign
on:
pull_request:
types:
- opened
jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- name: Set build URL to commit status
run: |
curl \
--request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data "{
\"assignees\": [\"${{ github.actor }}\"]
}"
25 changes: 14 additions & 11 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on: pull_request
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
node-version: [16, 18, 20]
Expand All @@ -14,12 +13,13 @@ jobs:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-node-modules
env:
cache-name: cache-node-modules
Expand All @@ -30,7 +30,7 @@ jobs:
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('./packages/*/package-lock.json') }}-${{ hashFiles('./package-lock.json') }}

- name: Cache turbo
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-turbo
with:
path: .turbo
Expand All @@ -45,12 +45,15 @@ jobs:
path: .turbo
key: turbo-master

- name: Install Dependencies
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci
run: npm ci --ignore-scripts

- run: node ./bin/validate-commit-messages.js
- run: npm run compile
- run: npm run lint
- run: npm run test
- name: Compile package
run: npm run compile

- name: Lint
run: npm run lint

- name: Test
run: npm run test
Loading

0 comments on commit 50976ce

Please sign in to comment.