{"id":19957219,"url":"https://github.com/jsdaddy/eslint-8-to-9","last_synced_at":"2026-02-09T04:31:45.359Z","repository":{"id":241388592,"uuid":"804975516","full_name":"JsDaddy/eslint-8-to-9","owner":"JsDaddy","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-05T08:55:41.000Z","size":329,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T07:12:23.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/JsDaddy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-23T16:28:59.000Z","updated_at":"2024-10-31T19:36:20.000Z","dependencies_parsed_at":"2025-01-12T07:11:58.220Z","dependency_job_id":"246c93c9-6802-40de-a16c-b4dca3241531","html_url":"https://github.com/JsDaddy/eslint-8-to-9","commit_stats":null,"previous_names":["jsdaddy/eslint-8-to-9"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsDaddy%2Feslint-8-to-9","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsDaddy%2Feslint-8-to-9/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsDaddy%2Feslint-8-to-9/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JsDaddy%2Feslint-8-to-9/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JsDaddy","download_url":"https://codeload.github.com/JsDaddy/eslint-8-to-9/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241389133,"owners_count":19955106,"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-13T01:36:58.825Z","updated_at":"2026-02-09T04:31:45.330Z","avatar_url":"https://github.com/JsDaddy.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESLint Version Upgrade Guide (v8 to v9) for Angular Projects\n\n## Overview\n\nThis guide outlines the steps to upgrade ESLint from version 8 to version 9 in an Angular project. Follow these steps to ensure compatibility and update your project's linting setup.\n\n## Instructions\n\n- Upgrade ESLint\n  - Execute the following command to upgrade ESLint from version 8 to version 9:\n    `npm i eslint@latest -D`\n- Create **eslint.config.js**\n  - Create a new file named **eslint.config.js** in the root directory of your project.\n- Update ESLint Configuration\n  - Install necessary packages:\n    `npm i typescript-eslint -D`\n  - Move the content from .eslintignore into **eslint.config.js**. Format it as follows:\n  ```javascript\n  import tseslint from \"typescript-eslint\";\n  export default tseslint.config({ ignores: [\"**/.angular/*\", \"**/test/*\"] });\n  ```\n- Remove .eslintignore\n  - Delete the **.eslintignore** file as its settings have been merged into **eslint.config.js**.\n- Configure **eslint.config.js** - for TypeScript Files\n\n  - Basic Configuration:\n\n  ```javascript\n  import tseslint from \"typescript-eslint\";\n  export default tseslint.config(\n    { ignores: [\"**/.angular/*\", \"**/test/*\"] },\n    {\n      files: [\"**/*.ts\"],\n      extends: [],\n      languageOptions: {},\n      rules: {},\n    },\n  );\n  ```\n\n  - Add languageOptions\n\n    - Install necessary packages:\n      `npm i globals -D`\n    - Update **eslint.config.js**:\n\n    ```javascript\n    import tseslint from \"typescript-eslint\";\n    import globals from \"globals\";\n    import typescriptEslintParser from \"@typescript-eslint/parser\";\n    export default tseslint.config(\n      ...\n      {\n        ...\n        languageOptions: {\n          ecmaVersion: 2020,\n          sourceType: \"module\",\n          parser: typescriptEslintParser,\n          parserOptions: {\n            project: [\"./tsconfig.json\"],\n            createDefaultProgram: true,\n          },\n          globals: {\n            ...globals.browser,\n            ...globals.jasmine,\n            Stripe: true,\n            cy: true,\n            Cypress: true,\n          },\n        },\n        ...\n      },\n      ...\n    );\n    ```\n\n  - Add Recommended Rules:\n\n    - Install recommended rules:\n      `npm i @eslint/js -D`\n      `npm i angular-eslint -D`\n    - Update **eslint.config.js**:\n\n    ```javascript\n    import eslint from \"@eslint/js\";\n    import angular from \"angular-eslint\";\n    import tseslint from \"typescript-eslint\";\n    export default tseslint.config(\n      ...\n      {\n        ...,\n        files: [\"**/*.ts\"],\n        extends: [\n          eslint.configs.recommended,\n          ...tseslint.configs.recommended,\n          ...tseslint.configs.stylistic,\n          ...angular.configs.tsRecommended,\n        ],\n        ...,\n      },\n      ...\n    );\n    ```\n\n  - Add additional Rules:\n\n    - Update **eslint.config.js**:\n\n    ```javascript\n    export default tseslint.config(\n      ...,\n      {\n        ...,\n        rules: {\n          ...,\n          \"@typescript-eslint/explicit-function-return-type\": \"error\",\n          \"lines-between-class-members\": [\n            \"error\",\n            {\n              enforce: [\n                { blankLine: \"never\", prev: \"field\", next: \"field\" },\n                { blankLine: \"always\", prev: \"field\", next: \"method\" },\n                { blankLine: \"always\", prev: \"method\", next: \"method\" },\n              ],\n            },\n          ],\n          \"@angular-eslint/component-selector\": [\n            \"error\",\n            {\n              prefix: \"app\",\n              style: \"kebab-case\",\n              type: \"element\",\n            },\n          ],\n          ...\n        },\n        ...,\n      },\n      ...\n    );\n    ```\n\n  - Final result\n\n  ```javascript\n  import typescriptEslintParser from \"@typescript-eslint/parser\";\n  import eslint from \"@eslint/js\";\n  import globals from \"globals\";\n  import angular from \"angular-eslint\";\n  import tseslint from \"typescript-eslint\";\n\n  export default tseslint.config(\n    {\n      ignores: [\n        \"**/.angular/*\",\n        \"**/.vscode/*\",\n        \"**/node_modules/*\",\n        \"**/dist/*\",\n      ],\n    },\n    {\n      files: [\"**/*.ts\"],\n      extends: [\n        eslint.configs.recommended,\n        ...tseslint.configs.recommended,\n        ...tseslint.configs.stylistic,\n        ...angular.configs.tsRecommended,\n      ],\n      languageOptions: {\n        ecmaVersion: 2020,\n        sourceType: \"module\",\n        parser: typescriptEslintParser,\n        parserOptions: {\n          project: [\"./tsconfig.json\"],\n          createDefaultProgram: true,\n        },\n        globals: {\n          ...globals.browser,\n          ...globals.jasmine,\n          Stripe: true,\n          cy: true,\n          Cypress: true,\n        },\n      },\n      rules: {\n        ...\n        \"@angular-eslint/component-selector\": [\n          \"error\",\n          {\n            prefix: \"app\",\n            style: \"kebab-case\",\n            type: \"element\",\n          },\n        ],\n        ...\n      },\n    },\n  );\n\n  ```\n\n- Repeat for Other Files\n  - Repeat the above steps to configure linting for other file types (**.html**, **.json**, **.js**).\n- Remove .eslintrc.json\n  - Eliminate the **.eslintrc.json** file since it has been superseded by **eslint.config.js**.\n- Run Lint\n\n  - To test the new setup, run:\n\n  ```javascript\n  npm run lint\n  ```\n\n## Note\n\n- To migrate eslint 8 to eslint 9 without angular-eslint follow [eslint-9-without-angular-eslint](https://github.com/JsDaddy/eslint-8-to-9/tree/eslint-9)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdaddy%2Feslint-8-to-9","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdaddy%2Feslint-8-to-9","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdaddy%2Feslint-8-to-9/lists"}