Skip to content

Commit

Permalink
refactor(examples): make examples code rely only on tsx (#117)
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
jerome-benoit authored Oct 13, 2024
1 parent 5e08d7d commit 6ae694f
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 72 deletions.
81 changes: 42 additions & 39 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.json", "examples/tsconfig.json"]
},
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"extends": [
"eslint:recommended",
"airbnb-base",
"plugin:@typescript-eslint/recommended"
],
"root": true,
"env": {
"node": true,
"commonjs": true
},
"rules": {
"import/no-extraneous-dependencies": "off",
"no-restricted-syntax": "off",
"no-await-in-loop": "off",
"no-plusplus": "off",
"no-promise-executor-return": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/ban-types": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"no-underscore-dangle": "off",
"indent": [
"error",
2
],
"max-len": 0
}
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"tsconfig.json",
"examples/tsconfig.json"
]
},
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"extends": [
"eslint:recommended",
"airbnb-base",
"plugin:@typescript-eslint/recommended"
],
"root": true,
"env": {
"node": true,
"commonjs": true
},
"rules": {
"import/no-extraneous-dependencies": "off",
"no-restricted-syntax": "off",
"no-await-in-loop": "off",
"no-plusplus": "off",
"no-promise-executor-return": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/ban-types": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"no-underscore-dangle": "off",
"indent": [
"error",
2
],
"max-len": 0
}
}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
FORCE_COLOR: 2

- name: Run examples
run: cd examples && pnpm run all
run: cd examples && pnpm all
4 changes: 3 additions & 1 deletion .nano-staged.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"*.ts": ["eslint --fix"]
"*.ts": [
"eslint --fix"
]
}
2 changes: 1 addition & 1 deletion .size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"path": "dist/index.cjs",
"limit": "10 kB"
}
]
]
4 changes: 1 addition & 3 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
"pnpm": "9.12.1"
},
"scripts": {
"build": "tsc",
"all": "pnpm simple",
"simple": "tsx src/simple.ts",
"dev:simple": "tsx --watch src/simple.ts"
},
"license": "ISC",
"devDependencies": {
"tsx": "^4.19.1",
"typescript": "^5.6.3"
"tsx": "^4.19.1"
}
}
10 changes: 2 additions & 8 deletions examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
{
"extends": "../tsconfig.json",
"include": [
"src/*.ts"
],
"exclude": [
"node_modules",
"dist"
"./src/*.ts"
],
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"baseUrl": ".",
"outDir": "dist"
"module": "ESNext"
},
}
28 changes: 9 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ae694f

Please sign in to comment.