{"id":19568482,"url":"https://github.com/runroom/npm-scripts","last_synced_at":"2025-04-27T02:33:02.656Z","repository":{"id":45047954,"uuid":"421773793","full_name":"Runroom/npm-scripts","owner":"Runroom","description":"This package contains basic npm scripts configs for Runroom frontend projects.","archived":false,"fork":false,"pushed_at":"2024-11-05T16:12:19.000Z","size":156,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-17T22:41:51.787Z","etag":null,"topics":["backup"],"latest_commit_sha":null,"homepage":"","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/Runroom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-10-27T10:30:03.000Z","updated_at":"2024-10-23T14:25:28.000Z","dependencies_parsed_at":"2023-11-09T17:28:19.740Z","dependency_job_id":"3d8ccb87-68b4-4c64-8214-fd52d4f96600","html_url":"https://github.com/Runroom/npm-scripts","commit_stats":{"total_commits":43,"total_committers":2,"mean_commits":21.5,"dds":"0.39534883720930236","last_synced_commit":"8e11c2cfa9d6b3c4bf47974d330d29b011ebf75b"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runroom%2Fnpm-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runroom%2Fnpm-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runroom%2Fnpm-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runroom%2Fnpm-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Runroom","download_url":"https://codeload.github.com/Runroom/npm-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251080744,"owners_count":21533142,"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":["backup"],"created_at":"2024-11-11T06:04:56.928Z","updated_at":"2025-04-27T02:33:02.079Z","avatar_url":"https://github.com/Runroom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `npm-scripts`\n\nThis package is a collection of basic `npm` script configurations for Runroom frontend projects. It\nprovides a set of pre-configured scripts and dependencies to streamline the development process and\nimprove code quality.\n\n## Features\n\n- Ready-to-use configurations for Babel, ESLint, Prettier, Stylelint, PostCSS, Tailwind, and Lint\n  Staged.\n- Multiple ESLint configurations available for plain JavaScript (vanilla), TypeScript, React, and\n  Next.js projects.\n- Customizable configurations that can be extended or merged to suit specific project needs.\n- Integration with popular testing frameworks like Cypress and Jest.\n- Automatic code formatting on save.\n- Easy installation of required dependencies for each configuration.\n\n## Getting Started\n\nTo get started with `npm-scripts`, follow these simple steps:\n\n1. Install the package as a development dependency in your project:\n\n```bash\nnpm install --save-dev @runroom/npm-scripts\n```\n\n2. Install the required dependencies based on the configurations you intend to use. You can either\n   install all dependencies for all configurations or only the ones required for each specific\n   configuration.\n\n3. Import or extend the desired configuration files into your project's configuration files ( e.g.,\n   `.babelrc.js`, `.eslintrc.js`, etc.).\n\n4. Customize the configurations as needed, adding or overriding rules to fit your project\n   requirements.\n\n5. Start using the pre-configured scripts and enjoy an enhanced development experience with improved\n   code quality.\n\n## Babel\n\nTo use the Babel configuration:\n\n```javascript\n// babel.config.js\n\nconst babelConfig = require('@runroom/npm-scripts').babelConfig;\n\nmodule.exports = babelConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @babel/preset-env\n```\n\n## ESLint\n\nWhen using ESLint, there are multiple configurations available to choose from. The configurations\ninclude support for plain JavaScript (vanilla), Cypress, Jest, TypeScript, React, and Next.js.\n\nTo use the ESLint configuration for plain JavaScript (vanilla):\n\n```javascript\n// .eslintrc.js\n\nconst eslintConfig = require('@runroom/npm-scripts').eslintConfig;\n\nmodule.exports = eslintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @babel/core @babel/eslint-parser eslint eslint-config-prettier eslint-config-standard prettier\n```\n\nTo use the ESLint configuration with testing support (Cypress + Jest):\n\n```javascript\n// .eslintrc.js\n\nconst eslintConfig = require('@runroom/npm-scripts').eslintWithTestConfig;\n\nmodule.exports = eslintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @babel/core @babel/eslint-parser @testing-library/jest-dom babel-jest eslint eslint-config-prettier eslint-config-standard eslint-plugin-cypress eslint-plugin-jest eslint-plugin-testing-library jest jest-transform-stub jest-watch-typeahead prettier\n```\n\nTo use the ESLint configuration for TypeScript:\n\n```javascript\n// .eslintrc.js\n\nconst eslintConfig = require('@runroom/npm-scripts').eslintTSConfig;\n\nmodule.exports = eslintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-config-standard prettier ts-loader typescript\n```\n\nTo use the ESLint configuration for TypeScript with testing support (Cypress + Jest):\n\n```javascript\n// .eslintrc.js\n\nconst eslintConfig = require('@runroom/npm-scripts').eslintTSWithTestConfig;\n\nmodule.exports = eslintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-jest eslint eslint-config-prettier eslint-config-standard eslint-plugin-cypress eslint-plugin-jest eslint\n\n-plugin-prettier eslint-plugin-testing-library jest jest-transform-stub jest-watch-typeahead prettier ts-loader typescript\n```\n\nTo use the ESLint configuration for React:\n\n```javascript\n// .eslintrc.js\n\nconst eslintConfig = require('@runroom/npm-scripts').eslintReactConfig;\n\nmodule.exports = eslintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser confusing-browser-globals eslint eslint-config-prettier eslint-config-standard eslint-plugin-react eslint-plugin-react-hooks prettier ts-loader typescript\n```\n\nTo use the ESLint configuration for Next.js:\n\n```javascript\n// .eslintrc.js\n\nconst eslintConfig = require('@runroom/npm-scripts').eslintNextConfig;\n\nmodule.exports = eslintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-next eslint-config-prettier eslint-config-standard prettier ts-loader typescript\n```\n\n### Custom Configuration\n\nIf you want to extend the default configurations, you can use the extends files and add them to your\nconfiguration file.\n\nFor example, to add Jest to the default TypeScript configuration:\n\n```javascript\n// .eslintrc.js\n\nconst eslintTS = require('@runroom/npm-scripts').eslintTSConfig;\nconst jest = require('@runroom/npm-scripts').eslintExtends.jest;\n\neslintTS.extends = [...eslintTS.extends, jest];\n\nmodule.exports = eslintTS;\n```\n\nYou can also build your own configuration using the extends files. For example, to create a React\nvanilla configuration with Jest:\n\n```javascript\n// .eslintrc.js\n\nconst base = require('@runroom/npm-scripts').eslintExtends.base;\nconst react = require('@runroom/npm-scripts').eslintExtends.react;\nconst jest = require('@runroom/npm-scripts').eslintExtends.jest;\n\nmodule.exports = {\n  extends: [base, react, jest]\n};\n```\n\n### How can I extend some configuration locally?\n\nFirst, consider if the rule really needs to be local to your project, or if creating a pull request\nto this repository to make it available to everyone is more appropriate.\n\nIf the rule needs to be local to your project, you can extend any configuration by overriding or\nmerging the exported object with your custom configuration.\n\nHere's an example of merging:\n\n```javascript\nconst eslintConfig = require('@runroom/npm-scripts').eslintConfig;\n\n// Merging\nmodule.exports = {\n  ...eslintConfig,\n  rules: {\n    ...eslintConfig.rules,\n    'your-game': 'your-rules'\n  }\n};\n\n// Overriding\nmodule.exports = {\n  ...eslintConfig,\n  rules: {\n    'your-game': 'your-rules'\n  }\n};\n```\n\n## Prettier\n\nTo use the Prettier configuration:\n\n```javascript\n// prettier.config.js\n\nconst prettierConfig = require('@runroom/npm-scripts').prettierConfig;\n\nmodule.exports = prettierConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev prettier\n```\n\n## Stylelint\n\nTo use the Stylelint configuration:\n\n```javascript\n// stylelint.config.js\n\nconst stylelintConfig = require('@runroom/npm-scripts').stylelintConfig;\n\nmodule.exports = stylelintConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev stylelint stylelint-config-standard stylelint-config-recommended\n```\n\n## PostCSS\n\nTo use the PostCSS configuration:\n\n```javascript\n// postcss.config.js\n\nconst postcssConfig = require('@runroom/npm-scripts').postcssConfig;\n\nmodule.exports = postcssConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev postcss postcss-import postcss-mixins postcss-sort-media-queries postcss-preset-env\n```\n\n## PostCSS Old\n\nTo use the PostCSS configuration:\n\n```javascript\n// postcssOld.config.js\n\nconst postcssConfig = require('@runroom/npm-scripts').postcssConfigOld;\n\nmodule.exports = postcssConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev postcss postcss-import postcss-functions postcss-space postcss-mixins postcss-simple-vars postcss-nested postcss-at-rules-variables postcss-sort-media-queries autoprefixer\n```\n\n## Tailwind\n\n🟠 **Important:** This configuration requires the use of [PostCSS](#postcss).\n\nTo use the Tailwind configuration:\n\n```javascript\n// tailwind.config.js\n\nconst tailwindConfig = require('@runroom/npm-scripts').tailwindConfig;\n\nmodule.exports = tailwindConfig;\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev tailwindcss\n```\n\n## Lint Staged\n\nTo use the Lint Staged configuration:\n\n```javascript\n// lint-staged.config.js\n\nconst lintStagedConfig = require('@runroom/npm-scripts').lintStagedConfig;\n\nmodule.exports = lintStagedConfig;\n```\n\n```json\n{\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"lint-staged\"\n    }\n  }\n}\n```\n\n**Required dependencies:**\n\n```bash\nnpm install --save-dev husky lint-staged\n```\n\n### VSC config\n\nThis configuration provides auto-formatting on save for `.js`, `.ts`, `.css`, and `.scss` files.\n\n```json\n{\n  \"[javascript]\": {\n    \"editor.formatOnSave\": true,\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[typescript]\": {\n    \"editor.formatOnSave\": true,\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  },\n  \"[css]\": {\n    \"editor.formatOnSave\": true,\n    \"editor.defaultFormatter\": \"esbenp.prettier-vscode\"\n  }\n}\n```\n\n### Contributing\n\nWe welcome contributions to npm-scripts! If you encounter any issues, have suggestions, or want to\nadd new features, please feel free to submit an issue or create a pull request.\n\n### License\n\nnpm-scripts is open-source software licensed under the MIT license. Feel free to use, modify, and\ndistribute it as per the terms of the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunroom%2Fnpm-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunroom%2Fnpm-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunroom%2Fnpm-scripts/lists"}