Skip to content

Commit

Permalink
feat: add debug capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Convly authored Dec 26, 2024
2 parents 6ac1ff4 + cd22911 commit 3151d0d
Show file tree
Hide file tree
Showing 28 changed files with 2,747 additions and 4,088 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🐛 Bug Report
description: Help us improve this repository by filing a detailed bug report.
title: '[bug]: '
labels: [ 'issue: bug', 'status: to be confirmed' ]
labels: ['issue: bug', 'status: to be confirmed']
body:
- type: textarea
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
npx --no-install lint-staged
pnpm run ts:check
pnpm run test --verbose=false
pnpm run test --coverage --verbose=false
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"src/*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm run prettier:write", "pnpm run lint"]
"{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm run prettier:write", "pnpm run lint:fix"]
}
98 changes: 57 additions & 41 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,64 @@ import pluginEslintImport from 'eslint-plugin-import';
import pluginTypescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';

export default {
languageOptions: {
parser: tsParser,
parserOptions: {
project: ['./tsconfig.eslint.json'],
},
},
files: ['{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}'],
plugins: {
'@typescript-eslint': pluginTypescriptEslint,
import: pluginEslintImport,
export default [
{
// the "ignores" patterns have to be defined as the only key of a config object
// see: https://eslint.org/docs/latest/use/configure/ignore#ignoring-directories
ignores: ['dist', '.coverage', '.vscode', '.idea'],
},
rules: {
// Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
// while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
// https://typescript-eslint.io/rules/no-unused-vars/
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
{
languageOptions: {
parser: tsParser,
parserOptions: {
project: ['./tsconfig.eslint.json'],
},
],
},
files: ['{src,tests}/**/*.{js,ts,yml,yaml}'],
plugins: {
'@typescript-eslint': pluginTypescriptEslint,
import: pluginEslintImport,
},
rules: {
// Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
// while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
// https://typescript-eslint.io/rules/no-unused-vars/
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],

// eslint-plugin-import
'import/no-default-export': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/first': ['error'],
'import/exports-last': ['error'],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
// eslint-plugin-import
'import/no-default-export': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/first': ['error'],
'import/exports-last': ['error'],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
},
},
};
];
25 changes: 18 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@
"url": "https://strapi.io"
}
],
"browser": "./dist/bundle.browser.min.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/bundle.cjs.js",
"import": "./dist/bundle.esm.js"
"import": "./dist/bundle.esm.js",
"browser": {
"import": "./dist/bundle.browser.min.js",
"require": "./dist/bundle.browser.min.js"
}
},
"./package.json": "./package.json"
},
Expand All @@ -42,6 +47,7 @@
"clean": "pnpm exec rimraf ./dist",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint:fix:dry": "eslint . --fix-dry-run",
"prepare": "husky",
"prettier:check": "prettier --check .",
"prettier:write": "prettier --write .",
Expand All @@ -55,28 +61,33 @@
"@commitlint/cli": "19.6.0",
"@commitlint/config-conventional": "19.6.0",
"@commitlint/types": "19.5.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-commonjs": "28.0.1",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-replace": "6.0.2",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.1",
"@strapi/eslint-config": "0.2.1",
"@types/jest": "^29.5.14",
"@types/debug": "4.1.12",
"@types/jest": "29.5.14",
"@typescript-eslint/eslint-plugin": "8.15.0",
"@typescript-eslint/parser": "8.15.0",
"eslint": "8.57.1",
"eslint-plugin-import": "2.31.0",
"husky": "9.1.7",
"jest": "^29.7.0",
"jest": "29.7.0",
"lint-staged": "15.2.10",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"rollup": "4.27.3",
"ts-jest": "^29.2.5",
"ts-jest": "29.2.5",
"typescript": "5.6.3"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.0.0 <=22.x.x",
"npm": ">=6.0.0"
},
"dependencies": {}
"dependencies": {
"debug": "4.4.0"
}
}
Loading

0 comments on commit 3151d0d

Please sign in to comment.