{"id":18783916,"url":"https://github.com/sparkpost/eslint-config-sparkpost","last_synced_at":"2025-04-13T12:27:01.150Z","repository":{"id":44661198,"uuid":"55423152","full_name":"SparkPost/eslint-config-sparkpost","owner":"SparkPost","description":"ESLint configuration for Javascript based SparkPost projects ","archived":false,"fork":false,"pushed_at":"2023-07-19T15:21:42.000Z","size":203,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-04-13T12:26:04.848Z","etag":null,"topics":["appteam","shared-lib","sp-utils","team-sa"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-config-sparkpost","language":"JavaScript","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/SparkPost.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-04T15:35:30.000Z","updated_at":"2023-03-03T22:35:10.000Z","dependencies_parsed_at":"2024-06-19T06:14:15.557Z","dependency_job_id":null,"html_url":"https://github.com/SparkPost/eslint-config-sparkpost","commit_stats":{"total_commits":86,"total_committers":12,"mean_commits":7.166666666666667,"dds":0.7441860465116279,"last_synced_commit":"4c453bf29495341d63a474cf732410a281191fec"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparkPost%2Feslint-config-sparkpost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparkPost%2Feslint-config-sparkpost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparkPost%2Feslint-config-sparkpost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SparkPost%2Feslint-config-sparkpost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SparkPost","download_url":"https://codeload.github.com/SparkPost/eslint-config-sparkpost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248713361,"owners_count":21149675,"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":["appteam","shared-lib","sp-utils","team-sa"],"created_at":"2024-11-07T20:41:09.583Z","updated_at":"2025-04-13T12:27:01.116Z","avatar_url":"https://github.com/SparkPost.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-config-sparkpost\nESLint configuration for Javascript and TypeScript based SparkPost projects \n\n## Upgrading from 2.x to 3.x\nThere were several breaking changes including moving from ESLint 5.x to ESLint 8.x.  This change alone caused some minimal breaking changes.  Since \nwe ultimately extend `eslint:recommended` in our base configuration, the upgrade from eslint 5.x to 8.x changed that 'recommended' config and the \nrules between versions have definitely changed.  We compensated to match our existing config as best we could, but you may find other changes when \nrunning ESLint in your projects.\n\nWe also moved several specific configs from overrides in the base config to their own specific configs. Mocha and TypeScript are used by some projects, \nhowever they are not used by every project so we have separated them to their own configs and moved their dependencies to optional peer dependencies\nso that we no longer need to install and maintain them in projects that don't use them. \n\n### Special Concerns for Mocha Based Projects\nTraditionally we've setup special rules for `mocha` based projects, however not all projects use `mocha`.  This would lead to dependencies being \ninstalled that were unrelated to the project.  For this reason, we have split `mocha` configuration into its own configuration.  You can take \nadvantage of it by extending `sparkpost/mocha` from this package.  This will require you to install the plugin `eslint-plugin-mocha` in the project's \ndev dependencies.\n\nExample:\n```shell\nnpm i -D eslint-plugin-mocha\n```\nIn your `.eslintrc` file: \n```json\n{\n  \"normal\": \"stuff \u003c- comment\",\n  \"overrides\": [\n    {\n      \"files\": [\"test/**/*.spec.js\"],\n      \"extends\": [\"sparkpost/mocha\"]\n    }\n  ]\n}\n```\n\n### Special Concerns for TypeScript Projects\nWe have several `typescript` based projects, however not all projects use `typescript`.  This would lead to dependencies being\ninstalled that were unrelated to the project.  For this reason, we have split `typescript` configuration into its own configuration.  You can take\nadvantage of it by extending `sparkpost/typescript` from this package.  This will require you to install several plugins and configs in the project's\ndev dependencies.\n\nExample:\n```shell\nnpm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-prettier\n```\nIn your `.eslintrc` file:\n```json\n{\n  \"normal\": \"stuff \u003c- comment\",\n  \"extends\": [\"sparkpost/typescript\"],\n  \"rules\": {\n    \"other\": \"rules that override the base typescript config \u003c- comment\"\n  }\n}\n```\n\n## Docs in Libraries\nThis config has extra rules specifically around JSDocs to help have better documentation in our libraries.  \nThis can help in knowledge sharing and will hopefully promote better docs in our shared JS modules. \n\nTo use, add the following to your `.eslintrc` file:\n```json\n{\n  \"extends\": \"sparkpost/lib\"\n}\n```\n\n### Automation for Checking Changelogs\n#### Add the npm scripts\n```json\n{\n  \"chk-changelog\": \"grep `node -e 'console.log(require(\\\"./package.json\\\").version);'` CHANGELOG.md || echo 'Please update CHANGELOG.md with your updates'; exit 255\",\n  \"prepublishOnly\": \"npm run chk-changelog\"\n}\n```\nThis will check your changelog for an entry for your current version when you publish.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkpost%2Feslint-config-sparkpost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsparkpost%2Feslint-config-sparkpost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkpost%2Feslint-config-sparkpost/lists"}