{"id":19241682,"url":"https://github.com/exuanbo/ts-standardx","last_synced_at":"2025-04-21T09:32:28.584Z","repository":{"id":54559194,"uuid":"308302373","full_name":"exuanbo/ts-standardx","owner":"exuanbo","description":"Yet another configurable linter for TypeScript and JavaScript.","archived":false,"fork":false,"pushed_at":"2021-11-06T17:47:37.000Z","size":2307,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-16T11:59:47.078Z","etag":null,"topics":["eslint","lint","prettier","standard","standardx","ts-standard","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exuanbo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-29T11:09:26.000Z","updated_at":"2024-08-15T14:44:21.000Z","dependencies_parsed_at":"2022-08-13T19:40:26.432Z","dependency_job_id":null,"html_url":"https://github.com/exuanbo/ts-standardx","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fts-standardx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fts-standardx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fts-standardx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exuanbo%2Fts-standardx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exuanbo","download_url":"https://codeload.github.com/exuanbo/ts-standardx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032149,"owners_count":21363780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","lint","prettier","standard","standardx","ts-standard","typescript"],"created_at":"2024-11-09T17:12:15.163Z","updated_at":"2025-04-21T09:32:28.172Z","avatar_url":"https://github.com/exuanbo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![ts-standardx](https://raw.githubusercontent.com/exuanbo/ts-standardx/main/logo.svg)](https://github.com/exuanbo/ts-standardx)\n\n\u003e Yet another configurable linter for TypeScript and JavaScript.\n\n[![npm](https://img.shields.io/npm/v/ts-standardx.svg)](https://www.npmjs.com/package/ts-standardx)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/exuanbo/ts-standardx/Node.js%20CI/main.svg)](https://github.com/exuanbo/ts-standardx/actions?query=workflow%3A%22Node.js+CI%22)\n[![Codecov branch](https://img.shields.io/codecov/c/gh/exuanbo/ts-standardx/main.svg?token=D9AA8C1ZS2)](https://codecov.io/gh/exuanbo/ts-standardx)\n[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)\n\n## 🚀 Features\n\nTodo\n\n## 💾 Install\n\n```sh\nnpm install --save-dev ts-standardx\n```\n\n## 🤖 CLI\n\n```sh\n$ npx ts-standardx\n```\n\nTo enable auto fix and format, use `--fix`.\n\n```sh\n$ npx ts-standardx --fix\n```\n\nTo lint text from stdin, use `-` or `--stdin`.\n\n```sh\n$ echo \"const greet = ( ) =\u003e 'hi'\" | npx ts-standardx -\n```\n\n\u003cdetails\u003e\u003csummary\u003eoutput\u003c/summary\u003e\n\u003cp\u003e\n\n```\n\u003ctext\u003e:1:7\n  error  'greet' is assigned a value but never used.  no-unused-vars\n\n\u003ctext\u003e:1:17\n  error  Delete `·`  prettier/prettier\n\nRun `ts-standardx --fix` to automatically fix some problems.\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cbr\u003e\n\nAdd `--fix` to output fixed text.\n\n```sh\n$ echo \"const greet = ( ) =\u003e 'hi'\" | npx ts-standardx - --fix\n```\n\n\u003cdetails\u003e\u003csummary\u003eoutput\u003c/summary\u003e\n\u003cp\u003e\n\n```\nconst greet = () =\u003e 'hi'\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### --help\n\n```\nts-standardx: Yet another configurable linter for TypeScript and JavaScript. (https://github.com/exuanbo/ts-standardx#readme)\n\nUsage: ts-standardx \u003cflags\u003e [FILES...]\n\n  If FILES is omitted, all source files (*.ts, *.tsx, *.js, *.jsx, *.mjs, *.cjs)\n  in the current working directory will be checked recursively.\n\n  By default, files/folders that begin with '.' like .eslintrc .cache/ and\n  paths in .gitignore are automatically ignored.\n\nBasic:\n  --fix                Automatically fix problems\n\nConfig:\n  --env                Use custom eslint environment\n  --ext                Specify file extensions\n  --global             Declare global variable\n  --parser             Use custom parser (e.g. babel-eslint)\n  --plugin             Use custom eslint plugin\n\nInput:\n  --stdin              Read file text from stdin\n  --disable-gitignore  Disable use of .gitignore by default\n\nMisc:\n  -h, --help           Show usage information\n  -v, --version        Show current version\n```\n\n## ⌨️ API\n\n\u003cdetails\u003e\n\u003csummary\u003eCheck\u003c/summary\u003e\n\u003cp\u003e\n\n```ts\n// index.d.ts\n\nimport {\n  ProvidedOptions,\n  Linter as __Linter,\n  CLI as __CLI\n} from 'standard-engine-ts'\n\ndeclare const options: ProvidedOptions\n\ndeclare class Linter extends __Linter {\n  constructor(customOptions?: ProvidedOptions)\n}\ndeclare class CLI extends __CLI {\n  constructor(customOptions?: ProvidedOptions)\n}\n\nexport { CLI, Linter, options }\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## ⚙️ Configuration\n\n`ts-standardx` uses `.eslintrc*` from the current working directory.\n\nNote that rules for TypeScript need to be placed in `overrides` as example below.\n\n```js\n// .eslintrc.js\n\nmodule.exports = {\n  overrides: [\n    {\n      files: ['**/*.ts', '**/*.tsx'],\n      rules: {\n        '@typescript-eslint/no-explicit-any': 'off'\n      }\n    }\n  ]\n}\n```\n\n`.prettierrc*` will be read from the current directory, but these options\n\n- `semi`\n- `singleQuote`\n- `trailingComma`\n- `bracketSameLine`\n- `arrowParens`\n\nwill not take effect. The only way to change them is setting in `.eslintrc*` as example below.\n\n```js\n// .eslintrc.js\n\nmodule.exports = {\n  rules: {\n    'prettier/prettier': ['error', { ...options }]\n  }\n}\n```\n\n### Editor extension\n\nAdd the [default config](#eslintrcts) to `extends` to use the official ESLint extension.\n\n```js\n// .eslintrc.js\n\nmodule.exports = {\n  extends: ['./node_modules/ts-standardx/.eslintrc.js']\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eBut wait a second...\u003c/summary\u003e\n\u003cp\u003e\n\n\"So why can't I use `npx eslint .` directly?\" Yes, you can :p\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## 🔎 Details\n\nThis package includes:\n\n- @typescript-eslint/eslint-plugin\n- @typescript-eslint/parser\n- eslint\n- eslint-config-prettier\n- eslint-config-standard\n- eslint-config-standard-jsx\n- eslint-plugin-import\n- eslint-plugin-node\n- eslint-plugin-prettier\n- eslint-plugin-promise\n- eslint-plugin-react\n- prettier\n- [standard-engine-ts](https://github.com/exuanbo/standard-engine-ts#readme)\n\n### eslintrc.ts\n\n\u003cdetails\u003e\n\u003csummary\u003eCheck\u003c/summary\u003e\n\u003cp\u003e\n\n```ts\nimport type { Linter } from 'eslint'\nimport { rules } from './rules'\nimport { prettierCompatRules, compatRules, prettierTypescriptCompatRules } from './compatRules'\nimport { isModuleAvailable } from './utils'\n\nconst PRETTIER_STANDARD = {\n  semi: false,\n  singleQuote: true,\n  trailingComma: 'none',\n  bracketSameLine: true,\n  arrowParens: 'avoid'\n}\n\nconst eslintrc: Linter.BaseConfig = {\n  extends: ['standard', 'standard-jsx', 'prettier'],\n  plugins: ['prettier'],\n  rules: {\n    'prettier/prettier': ['error', PRETTIER_STANDARD],\n    ...prettierCompatRules\n  },\n  overrides: isModuleAvailable('typescript')\n    ? [\n        {\n          files: ['**/*.ts', '**/*.tsx'],\n          extends: ['plugin:@typescript-eslint/recommended'],\n          rules: {\n            ...rules,\n            ...compatRules,\n            ...prettierTypescriptCompatRules\n          }\n        }\n      ]\n    : undefined\n}\n\nexport default eslintrc\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## 🤔 Why\n\nTodo\n\n## 📃 Todo\n\n- [ ] Document\n- [ ] Allow specify `parserOptions.project`\n- [ ] Remove `eslint-config-standard-jsx`\n\n## License\n\n[MIT License](https://github.com/exuanbo/ts-standardx/blob/main/LICENSE) © 2021 [Exuanbo](https://github.com/exuanbo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexuanbo%2Fts-standardx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexuanbo%2Fts-standardx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexuanbo%2Fts-standardx/lists"}