{"id":22266528,"url":"https://github.com/csssr/linters","last_synced_at":"2025-07-28T10:33:03.329Z","repository":{"id":49544845,"uuid":"329932219","full_name":"CSSSR/linters","owner":"CSSSR","description":"CSSSR's linting configs for Prettier and ESLint.","archived":false,"fork":false,"pushed_at":"2023-07-12T11:46:13.000Z","size":1528,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-30T03:34:48.698Z","etag":null,"topics":["eslint","internal","linter","prettier"],"latest_commit_sha":null,"homepage":"https://csssr.github.io/linters/","language":"JavaScript","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/CSSSR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-15T14:18:46.000Z","updated_at":"2023-08-29T07:59:22.000Z","dependencies_parsed_at":"2024-10-22T20:23:12.026Z","dependency_job_id":null,"html_url":"https://github.com/CSSSR/linters","commit_stats":{"total_commits":65,"total_committers":8,"mean_commits":8.125,"dds":0.5846153846153845,"last_synced_commit":"60e008c25928807876f41b464677f3dac277d4f1"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSSSR%2Flinters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSSSR%2Flinters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSSSR%2Flinters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSSSR%2Flinters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSSSR","download_url":"https://codeload.github.com/CSSSR/linters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227895849,"owners_count":17836480,"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","internal","linter","prettier"],"created_at":"2024-12-03T10:19:07.127Z","updated_at":"2024-12-03T10:19:07.769Z","avatar_url":"https://github.com/CSSSR.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[CSSSR](https://csssr.com)'s linting configs for Prettier and ESLint.\n\n## [Documentation](https://csssr.github.io/linters/)\n\n## Installation\n\nFirst install `@csssr/linters` itself:\n```bash\nnpm i -D @csssr/linters\n\nyarn add -D @csssr/linters\n```\n\nThen install peer dependencies (Prettier, ESLint and its plugins):\n```bash\nnpx install-peerdeps -D @csssr/linters\n```\n\n## Prettier configuration\n\nYou may use your own Prettier config or use predefined one:\n\n```js\n// File: .prettierrc.js\nmodule.exports = {\n  ...require('@csssr/linters/prettier.config'),\n}\n```\n\n## ESLint configuration\n\nThere are several predefined configurations, which you may include in your project based on your project needs:\n* `eslint/base` - basic JavaScript rules including Prettier rule\n* `exlint/react` - React and JSX rules\n* `eslint/typescript` - TS-specific rules\n\n## Linting Babel project\n\nInstall [`@babel/eslint-parser`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser#installation) and add it as a parser to ESLint config:\n```js\n// File: .eslintrc.js\nmodule.exports = {\n  parser: \"@babel/eslint-parser\",\n  extends: [\n    require.resolve('@csssr/linters/eslint/base'),\n    require.resolve('@csssr/linters/eslint/react'),\n  ],\n}\n```\n\n## Linting TypeScript project\n\n```js\n// File: .eslintrc.js\nmodule.exports = {\n  extends: [\n    require.resolve('@csssr/linters/eslint/base'),\n    require.resolve('@csssr/linters/eslint/react'),\n    require.resolve('@csssr/linters/eslint/typescript'),\n  ],\n}\n```\n\n`tsconfig.json` from root of the project will be used for gathering type info for some rules. If your TS config is located elsewhere, configure its path in [`parserOptions.project`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject) field of ESLint config.\n\nOnly files specified in `include` section of `tsconfig.json` will be linted. Because of that configs located in the root folder (`.eslintrc.js`, `.prettierrc.js`, etc.) will not be linted but can still be formatted with Prettier.\n\n## Linting mixed project (JS and TS)\n\n```js\nmodule.exports = {\n  extends: [\n    require.resolve('@csssr/linters/eslint/base'),\n  ],\n  overrides: [\n    {\n      files: ['**/*.ts', '**/*.tsx'],\n      extends: [require.resolve('@csssr/linters/eslint/typescript')],\n    },\n  ],\n}\n\n```\n\n## Customization\n\nFeel free to add new plugins and rules and disable existing rules which are not suitable for your project's needs:\n\n```js\n// File: .eslintrc.js\nmodule.exports = {\n  extends: [\n    require.resolve('@csssr/linters/eslint/base'),\n    require.resolve('@csssr/linters/eslint/react'),\n    require.resolve('@csssr/linters/eslint/typescript'),\n  ],\n  plugins: ['todo-plz'],\n  rules: {\n    // Disabling for Next project\n    'jsx-a11y/anchor-is-valid': 'off',\n    \n    // New rule for linting todos\n    'todo-plz/ticket-ref': [\n      'error',\n      {\n        pattern: 'PROJ-[0-9]+',\n        terms: ['TODO', 'todo'],\n      },\n    ],\n  },\n  overrides: [\n    {\n      // Storybook's CSF requires usage of default exports\n      files: ['./src/**/index.stories.tsx'],\n      rules: {\n        'import/no-default-export': ['off'],\n      },\n    },\n  ],\n}\n```\n\nYou can find more recommendations for manual configuration [here](https://csssr.github.io/linters/recommendations.html).\n\n## [Contributing](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsssr%2Flinters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsssr%2Flinters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsssr%2Flinters/lists"}