Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ jobs:
node-version: 20
cache: 'yarn'
- run: yarn install --immutable --immutable-cache
- run: yarn tsc
- run: yarn oxlint .
- run: yarn prettier --check .
- run: yarn eslint .
- run: yarn turbo tsc lint
- name: Validate package setup
run: |
yarn setup
yarn prettier --write .
yarn nano-staged
git diff --exit-code -- . :^.yarn

Unit:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.yarn
.tshy
coverage
dist
109 changes: 2 additions & 107 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,108 +1,3 @@
// @ts-check
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import nodePlugin from 'eslint-plugin-n';
import oxlint from 'eslint-plugin-oxlint';
import config from '@repo/eslint-config';

export default tseslint.config(
{
ignores: [
'.git',
'node_modules',
'coverage',
'.yarn',
'packages/*/dist/**',
'packages/*/node_modules/**',
'packages/*/__snapshots__/**',
],
},
eslint.configs.recommended,
nodePlugin.configs['flat/recommended-module'],
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
rules: {
'n/hashbang': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-null': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
},
},
{
files: ['**/*.mts', '**/*.ts'],
extends: [...tseslint.configs.strictTypeChecked],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
},
},
{
files: ['**/*.cjs'],
extends: [nodePlugin.configs['flat/recommended-script']],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['packages/inquirer/test/**', 'packages/**/*.test.*'],
rules: {
'@typescript-eslint/unbound-method': 'off',
'n/no-extraneous-import': [
'error',
{
allowModules: ['vitest'],
},
],
'n/no-extraneous-require': [
'error',
{
allowModules: ['vitest'],
},
],
'n/no-unsupported-features/node-builtins': [
'error',
{
version: '>=22.0.0',
},
],
},
},
{
files: [
'tools/**',
'integration/**',
'packages/inquirer/examples/**',
'packages/demo/**',
],
rules: {
'n/no-unsupported-features/node-builtins': [
'error',
{
version: '>=22.0.0',
},
],
},
},
...oxlint.configs['flat/recommended'],
);
export default config;
86 changes: 86 additions & 0 deletions internals/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// @ts-check
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import nodePlugin from 'eslint-plugin-n';
import oxlint from 'eslint-plugin-oxlint';

export default tseslint.config(
{
ignores: [
'.git',
'node_modules',
'coverage',
'.yarn',
'**/dist/**',
'**/node_modules/**',
'**/__snapshots__/**',
],
},
eslint.configs.recommended,
nodePlugin.configs['flat/recommended-module'],
{
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
rules: {
'n/hashbang': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-null': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
},
},
{
files: ['**/*.mts', '**/*.ts'],
extends: [...tseslint.configs.strictTypeChecked],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
},
},
{
files: ['**/*.cjs'],
extends: [nodePlugin.configs['flat/recommended-script']],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['**/test/**', '**/*.test.*', 'tools/**', 'packages/inquirer/examples/**'],
rules: {
'@typescript-eslint/unbound-method': 'off',
'n/no-extraneous-import': [
'error',
{
allowModules: ['vitest'],
},
],
'n/no-unsupported-features/node-builtins': [
'error',
{
version: '>=22.0.0',
},
],
},
},
...oxlint.configs['flat/recommended'],
);
15 changes: 15 additions & 0 deletions internals/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@repo/eslint-config",
"version": "0.0.0",
"private": true,
"type": "module",
"main": "index.js",
"dependencies": {
"@eslint/js": "^9.31.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-n": "^17.21.0",
"eslint-plugin-oxlint": "^1.7.0",
"globals": "^16.3.0",
"typescript-eslint": "^8.37.0"
}
}
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"prepack": "find packages/* -maxdepth 1 -type f -name 'README*' -exec sed -i '' -e 's/utm_source=github/utm_source=npmjs/g' {} + && find packages/* -maxdepth 1 -type f -name package.json -exec sh -c 'jq \".devDependencies |= with_entries(select(.value != \\\"workspace:*\\\"))\" \"$1\" > \"$1.tmp\" && mv \"$1.tmp\" \"$1\"' _ {} \\;",
"postpack": "git restore packages/*/package.json packages/*/README.md",
"setup": "node ./tools/setup-packages.mjs",
"pretest": "turbo tsc && oxlint && prettier --check . && eslint . && yarn tsc:test",
"pretest": "turbo tsc lint && yarn tsc:test",
"test": "vitest --run packages && node --test integration/**/*.test.*",
"tsc": "turbo tsc",
"tsc:test": "tsc -p tsconfig.json"
Expand All @@ -75,17 +75,13 @@
"type-fest": "^4.0.0"
},
"devDependencies": {
"@eslint/js": "^9.31.0",
"@repo/eslint-config": "workspace:*",
"@repo/hoist-peer-dependencies": "workspace:*",
"@repo/tsconfig": "workspace:*",
"@types/node": "^24.0.15",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"eslint": "^9.31.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-n": "^17.21.0",
"eslint-plugin-oxlint": "^1.7.0",
"globals": "^16.3.0",
"globby": "^14.1.0",
"husky": "^9.1.7",
"lerna": "^8.2.3",
Expand All @@ -94,7 +90,6 @@
"prettier": "^3.6.2",
"turbo": "^2.5.5",
"typescript": "^5.8.3",
"typescript-eslint": "^8.37.0",
"vitest": "^3.2.4"
},
"packageManager": "[email protected]+sha512.5a0afa1d4c1d844b3447ee3319633797bcd6385d9a44be07993ae52ff4facabccafb4af5dcd1c2f9a94ac113e5e9ff56f6130431905884414229e284e37bb7c9",
Expand Down
3 changes: 3 additions & 0 deletions packages/checkbox/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@repo/eslint-config';

export default config;
4 changes: 3 additions & 1 deletion packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
],
"scripts": {
"attw": "attw --pack",
"tsc": "tshy"
"tsc": "tshy",
"lint": "oxlint --config=../../.oxlintrc.json && eslint . && prettier . --check --config=../../.prettierrc.mjs --ignore-path=../../.prettierignore"
},
"dependencies": {
"@inquirer/core": "^10.1.14",
Expand All @@ -83,6 +84,7 @@
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@inquirer/testing": "^2.1.48",
"@repo/eslint-config": "workspace:*",
"@repo/tsconfig": "workspace:*",
"tshy": "^3.0.2"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/confirm/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@repo/eslint-config';

export default config;
4 changes: 3 additions & 1 deletion packages/confirm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
],
"scripts": {
"attw": "attw --pack",
"tsc": "tshy"
"tsc": "tshy",
"lint": "oxlint --config=../../.oxlintrc.json && eslint . && prettier . --check --config=../../.prettierrc.mjs --ignore-path=../../.prettierignore"
},
"dependencies": {
"@inquirer/core": "^10.1.14",
Expand All @@ -80,6 +81,7 @@
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@inquirer/testing": "^2.1.48",
"@repo/eslint-config": "workspace:*",
"@repo/tsconfig": "workspace:*",
"tshy": "^3.0.2"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/core/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@repo/eslint-config';

export default config;
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
],
"scripts": {
"attw": "attw --pack",
"tsc": "tshy"
"tsc": "tshy",
"lint": "oxlint --config=../../.oxlintrc.json && eslint . && prettier . --check --config=../../.prettierrc.mjs --ignore-path=../../.prettierignore"
},
"dependencies": {
"@inquirer/figures": "^1.0.12",
Expand All @@ -86,6 +87,7 @@
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@inquirer/testing": "^2.1.48",
"@repo/eslint-config": "workspace:*",
"@repo/tsconfig": "workspace:*",
"@types/mute-stream": "^0.0.4",
"@types/node": "^24.0.15",
Expand Down
3 changes: 3 additions & 0 deletions packages/demo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@repo/eslint-config';

export default config;
6 changes: 4 additions & 2 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"dist"
],
"scripts": {
"tsc": "tshy"
"tsc": "tshy",
"lint": "oxlint --config=../../.oxlintrc.json && eslint . && prettier . --check --config=../../.prettierrc.mjs --ignore-path=../../.prettierignore"
},
"dependencies": {
"@inquirer/core": "^10.1.14",
Expand All @@ -76,12 +77,13 @@
"yoctocolors-cjs": "^2.1.2"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/tsconfig": "workspace:*",
"@types/node": "^24.0.15",
"tshy": "^3.0.2"
},
"engines": {
"node": ">=18"
"node": ">=22"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 3 additions & 0 deletions packages/editor/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@repo/eslint-config';

export default config;
4 changes: 3 additions & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
],
"scripts": {
"attw": "attw --pack",
"tsc": "tshy"
"tsc": "tshy",
"lint": "oxlint --config=../../.oxlintrc.json && eslint . && prettier . --check --config=../../.prettierrc.mjs --ignore-path=../../.prettierignore"
},
"dependencies": {
"@inquirer/core": "^10.1.14",
Expand All @@ -81,6 +82,7 @@
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@inquirer/testing": "^2.1.48",
"@repo/eslint-config": "workspace:*",
"@repo/tsconfig": "workspace:*",
"tshy": "^3.0.2"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/expand/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@repo/eslint-config';

export default config;
Loading
Loading