{"id":15043784,"url":"https://github.com/springload/eslint-plugin-springload","last_synced_at":"2025-08-02T05:31:29.628Z","repository":{"id":57230230,"uuid":"93950847","full_name":"springload/eslint-plugin-springload","owner":"springload","description":"Springload's ESLint shareable configurations, as a plugin.","archived":false,"fork":false,"pushed_at":"2022-08-09T03:41:07.000Z","size":84,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-06-07T10:48:24.891Z","etag":null,"topics":["eslint","eslint-config","eslint-plugin","javascript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-springload","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/springload.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":null,"security":null,"support":null}},"created_at":"2017-06-10T16:13:35.000Z","updated_at":"2018-06-10T23:40:10.000Z","dependencies_parsed_at":"2022-09-14T21:10:36.495Z","dependency_job_id":null,"html_url":"https://github.com/springload/eslint-plugin-springload","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/springload/eslint-plugin-springload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Feslint-plugin-springload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Feslint-plugin-springload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Feslint-plugin-springload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Feslint-plugin-springload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/eslint-plugin-springload/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Feslint-plugin-springload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268339400,"owners_count":24234544,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","eslint-config","eslint-plugin","javascript"],"created_at":"2024-09-24T20:49:35.477Z","updated_at":"2025-08-02T05:31:29.317Z","avatar_url":"https://github.com/springload.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-springload [![npm](https://img.shields.io/npm/v/eslint-plugin-springload.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-springload) [![Build Status](https://travis-ci.org/springload/eslint-plugin-springload.svg?branch=master)](https://travis-ci.org/springload/eslint-plugin-springload)\n\n\u003e Springload's ESLint shareable configurations, as a plugin.\n\n## Why\n\nWe want shareable configs to have as low of an overhead as possible. Users shouldn't have to know exactly what plugins are required by the config, install them and manage their versions manually. This plugin exposes [`eslint-config-springload`](https://github.com/springload/eslint-config-springload) for reuse, with plugins automatically installed.\n\n\u003e See [https://github.com/eslint/eslint/issues/3458](https://github.com/eslint/eslint/issues/3458) for further discussion on this topic. Approach inspired by [`eslint-plugin-react-app`](https://github.com/mmazzarolo/eslint-plugin-react-app).\n\n## Usage\n\nInstall the config and its dependencies:\n\n```sh\nnpm install --save-dev eslint@3 eslint-plugin-springload\n```\n\nConfigure ESLint to use this config. For example, in your package.json, this would be:\n\n```json\n\"eslintConfig\": {\n  \"extends\": \"plugin:springload/recommended\"\n},\n```\n\n### With Prettier\n\nThis ESLint plugin comes with a built-in Prettier-compatible config. First, install Prettier:\n\n```sh\nnpm install --save-dev prettier\n```\n\nSwitch to the Prettier config:\n\n```json\n\"eslintConfig\": {\n  \"extends\": \"plugin:springload/prettier\"\n},\n```\n\nThen, to configure Prettier itself, create a `prettier.config.js` file in the root of your project with:\n\n```js\n// Use the Prettier config that comes with eslint-plugin-springload.\nmodule.exports = require('eslint-plugin-springload/prettier.config');\n```\n\n### Integration in a development workflow\n\nFor Springload projects, linting commands are defined in the package.json as [npm scripts](https://docs.npmjs.com/misc/scripts). Here are example commands leveraging the ESLint and Prettier configuration, to process code in a `lib` subfolder:\n\n```json\n\"scripts\": {\n    \"linter:js\": \"eslint\",\n    \"formatter:js\": \"prettier --write\",\n    \"lint\": \"npm run linter:js -s -- lib\",\n    \"format\": \"npm run formatter:js -s -- lib/**/*.js\",\n}\n```\n\nThose commands can then be ran manually.\n\n#### Usage with git pre-commit hook\n\nThe above commands are meant to be usable on arbitrary lists of files. Here is an example `pre-commit` script that leverages them to re-format and lint JS when committing:\n\n```sh\n# Only keep staged files that are added (A), copied (C) or modified (M).\nSTAGED=$(git --no-pager diff --name-only --cached --diff-filter=ACM)\n# Files which are only partly staged (eg. git add --patch).\nPATCH_STAGED=$(git --no-pager diff --name-only --diff-filter=ACM $STAGED)\n# Files which are fully staged.\nFULLY_STAGED=$(comm -23 \u003c(echo \"$STAGED\") \u003c(echo \"$PATCH_STAGED\"))\n\nJS_STAGED=$(grep .js$ \u003c\u003c\u003c \"$STAGED\" || true)\nJS_FULLY_STAGED=$(grep .js$ \u003c\u003c\u003c \"$FULLY_STAGED\" || true)\nSNAPSHOT_STAGED=$(grep .snap$ \u003c\u003c\u003c \"$STAGED\" || true)\n\nif [ -n \"$JS_FULLY_STAGED\" ];\nthen\n    # Format and re-stage fully staged files only.\n    npm run formatter:js -s -- $JS_FULLY_STAGED\n    git add $JS_FULLY_STAGED\nfi\n\nif [ -n \"$JS_STAGED\" ];\nthen\n    npm run linter:js -s -- $JS_STAGED\nfi\n```\n\n### Configuring the rules\n\nThis is a drop-in configuration for Springload projects. Should further customisation be required, rules coming from external plugins require the `springload` prefix:\n\n```diff\n{\n  \"extends\": \"plugin:springload/recommended\"\n  \"rules\": {\n-    \"react/react-in-jsx-scope\": [\"warn\"],\n+    \"springload/react/react-in-jsx-scope\": [\"warn\"],\n-    \"import/prefer-default-export\": [\"warn\"],\n+    \"springload/import/prefer-default-export\": [\"warn\"],\n  }\n}\n```\n\n### Usage\n\n## Development\n\n### Install\n\n```sh\ngit clone git@github.com:springload/eslint-plugin-springload.git\ncd eslint-plugin-springload\nnvm install\n# Then, install all project dependencies.\nnpm install\n# Install the git hooks.\n./.githooks/deploy\n```\n\n### Development\n\n```sh\n# Runs linting.\nnpm run lint\n# Runs tests.\nnpm run test\n```\n\n### Releases\n\nThis project follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html) as well as ESLint's [Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).\n\n```sh\n# 1. Make a new branch for the release of the new version.\ngit chore release-vx.y.z\n# 2. Update the version in package.json\n# 3. Use irish-pub to check the package content. Install with `npm install -g` first.\nirish-pub\n# 4. Update the [CHANGELOG](CHANGELOG.md) for the upcoming release.\n# 5. Create a PR and merge it.\n# 6. On master,\nnpm publish\n# 7. Finally, go to GitHub and create a release and a tag for the new version.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Feslint-plugin-springload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Feslint-plugin-springload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Feslint-plugin-springload/lists"}