{"id":18458316,"url":"https://github.com/crazyfactory/tslint-rules","last_synced_at":"2025-10-17T16:42:27.249Z","repository":{"id":44844352,"uuid":"153602917","full_name":"crazyfactory/tslint-rules","owner":"crazyfactory","description":"tslint rules","archived":false,"fork":false,"pushed_at":"2023-01-04T16:01:09.000Z","size":1021,"stargazers_count":1,"open_issues_count":19,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-20T21:35:38.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazyfactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-18T10:00:30.000Z","updated_at":"2020-09-10T09:36:34.000Z","dependencies_parsed_at":"2023-02-02T18:18:30.737Z","dependency_job_id":null,"html_url":"https://github.com/crazyfactory/tslint-rules","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Ftslint-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Ftslint-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Ftslint-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyfactory%2Ftslint-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazyfactory","download_url":"https://codeload.github.com/crazyfactory/tslint-rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250431721,"owners_count":21429542,"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":[],"created_at":"2024-11-06T08:17:50.774Z","updated_at":"2025-10-17T16:42:22.231Z","avatar_url":"https://github.com/crazyfactory.png","language":"TypeScript","readme":"# tslint-rules\n\n\u003c!--[![Greenkeeper badge](https://badges.greenkeeper.io/crazyfactory/tslint-rules.svg)](https://greenkeeper.io/) --\u003e\n[![Build Status](https://travis-ci.org/crazyfactory/tslint-rules.svg)](https://travis-ci.org/crazyfactory/tslint-rules)\n[![GitHub issues](https://img.shields.io/github/issues/crazyfactory/tslint-rules.svg)](https://github.com/crazyfactory/tslint-rules/issues)\n[![codecov](https://codecov.io/gh/crazyfactory/tslint-rules/branch/master/graph/badge.svg)](https://codecov.io/gh/crazyfactory/tslint-rules)\n[![devDependencies Status](https://david-dm.org/crazyfactory/tslint-rules/dev-status.svg)](https://david-dm.org/crazyfactory/tslint-rules?type=dev)\n[![dependencies Status](https://david-dm.org/crazyfactory/tslint-rules/status.svg)](https://david-dm.org/crazyfactory/tslint-rules)\n\nContains lint rules for Crazy Factory\n\n- Typescript 3.x\n- packs it for npm usage\n- uses jest for testing\n- uses travis and semantic-release for deployment\n- uses linting, coverage and git hooks to increase code quality.\n- is configured to support wallaby\n\n## Usage\n\nInitially you should:\n\n- npm install `@crazyfactory/tslint-rules`\n- update `tslint.json` (add rules directory)\n- enable rules in `tslint.json`\n\n## Rules\n\n### `create-async-actions`\n  - In [ts-react-boilerplate](https://github.com/crazyfactory/ts-react-boilerplate), we use `createAsyncActions` to \n  create Redux async actions. Four actions are created from calling it - `BASE`, `BASE_PENDING`, `BASE_FULFILLED`, and\n  `BASE_REJECTED` as an example when `createAsyncActions(\"BASE\", \"BASE_PENDING\", \"BASE_FULFILLED\", \"BASE_REJECTED\"` is\n  called. Still, as you see, we need to provide string literal as arugments due to typescript limitation, if we provide\n  any string variable, the type will be deduced to just `string`. This rule enforces 2nd, 3rd, and 4th argument to be\n  the concatenation of the first argument string and `_PENDING`, `_FULFILLED`, and `_REJECTED` respectively.\n### `enum-sort-keys`\n  - Same as [object-literal-sort-keys](https://palantir.github.io/tslint/rules/object-literal-sort-keys/) but applied to\n  enum keys\n### `import-react`\n  - Specify how you should import `react`. Either `import *` or `import React`.\n  - Rule options:\n    - `type: \"default\" | \"star\"`. Default is `star`\n### `hex-format`\n  - Requires literal string in hex format to be uppercase/lowercase and/or of specific lengths.\n  - Rule options: \n    - `case: \"uppercase\" | \"lowercase\"`. Default is `lowercase`\n    - `allowedLengths: number[]`. Default is `[4, 7]`\n### \u003cdel\u003e`interface-sort-keys`\u003c/del\u003e\n  - Please use [member-ordering](https://palantir.github.io/tslint/rules/member-ordering/) instead!\n### `jsx-space-before-trailing-slash`\n  - Requires or bans space before `/\u003e` part of jsx.\n  - Rule options:\n    - `[\"always\", \"never\"]`. Default is `always`.\n### `language`\n  - Requires that string argument called by `Translator` object is in the `reference.json`\n  - Rule options:\n    - `path`: path to `reference.json`\n\n    `reference.json` needs to be in the following format:\n\n    ```\n      {\n        \"reference\": [\n          {\n            \"base\": \"Translation String Here\"\n          }\n        ]\n      }\n    ```\n    - `callerNames: string[]`: Name of translator object type, default is `[\"Translator\"]`\n### `no-dup-actions`\n  - Requires that all actions created by [createAsyncActions](https://github.com/crazyfactory/ts-react-boilerplate/blob/master/src/app/redux/modules/baseModule.ts)\n  and [createAction](https://github.com/piotrwitek/typesafe-actions#createaction) have unique name.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyfactory%2Ftslint-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazyfactory%2Ftslint-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyfactory%2Ftslint-rules/lists"}