{"id":16365249,"url":"https://github.com/mrmartineau/scripts","last_synced_at":"2026-04-06T01:35:27.794Z","repository":{"id":138466581,"uuid":"186253456","full_name":"mrmartineau/scripts","owner":"mrmartineau","description":"Shareable config scripts","archived":false,"fork":false,"pushed_at":"2019-05-12T12:42:12.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T16:19:24.272Z","etag":null,"topics":["babel","eslint","jest","prettier","react","reactjs","stylelint","tslint","typescript"],"latest_commit_sha":null,"homepage":null,"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/mrmartineau.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":"2019-05-12T12:41:55.000Z","updated_at":"2019-05-12T18:26:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"81cc4d36-2fee-4de6-8b19-49a877392fea","html_url":"https://github.com/mrmartineau/scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrmartineau/scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmartineau%2Fscripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmartineau%2Fscripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmartineau%2Fscripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmartineau%2Fscripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrmartineau","download_url":"https://codeload.github.com/mrmartineau/scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmartineau%2Fscripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31456662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["babel","eslint","jest","prettier","react","reactjs","stylelint","tslint","typescript"],"created_at":"2024-10-11T02:43:08.877Z","updated_at":"2026-04-06T01:35:27.778Z","avatar_url":"https://github.com/mrmartineau.png","language":"JavaScript","readme":"# ⚡ @mrmartineau/scripts\n\n\u003e Shareable config scripts\n\n```sh\nyarn add --dev @mrmartineau/scripts\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of contents\u003c/summary\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Babel](#babel)\n- [ESLint](#eslint)\n  - [Base `.eslintrc`](#base-eslintrc)\n  - [React `.eslintrc`](#react-eslintrc)\n  - [Typescript `.eslintrc`](#typescript-eslintrc)\n  - [Typescript and React `.eslintrc`](#typescript-and-react-eslintrc)\n- [Jest](#jest)\n    - [Using the default config](#using-the-default-config)\n    - [Overriding the default config](#overriding-the-default-config)\n  - [Jest + Typescript](#jest--typescript)\n- [Prettier](#prettier)\n- [Rollup](#rollup)\n  - [Add extra Rollup plugins](#add-extra-rollup-plugins)\n- [Stylelint](#stylelint)\n- [TSLint](#tslint)\n  - [Base `tslint.json`](#base-tslintjson)\n  - [React `tslint.json`](#react-tslintjson)\n- [TypeScript](#typescript)\n    - [Single package repo](#single-package-repo)\n  - [Mono repo](#mono-repo)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\u003c/details\u003e\n\n## Babel\n\nTo use this config, create an `.babelrc` file in the root of your package and add:\n\n```json\n{\n  \"extends\": \"@mrmartineau/scripts/babel\"\n}\n```\n\nThis babel config excludes some EcmaScript features, so you may need a polyfill for them:\n\n```\nhttps://polyfill.io/v3/polyfill.min.js?flags=gated\u0026callback=init\u0026features=default%2CArray.prototype.includes%2CArray.prototype.findIndex%2CArray.prototype.find%2CFunction.prototype.name\n```\n\nor\n\n```html\n\u003cscript\n  crossorigin=\"anonymous\"\n  src=\"https://polyfill.io/v3/polyfill.min.js?flags=gated\u0026callback=init\u0026features=default%2CArray.prototype.includes%2CArray.prototype.findIndex%2CArray.prototype.find%2CFunction.prototype.name\"\n\u003e\u003c/script\u003e\n```\n\n## ESLint\n\nThere are four eslint configs available:\n\n- **Base**: for general purpose usage\n- **React**: extends the base, for use with React\n- **Typescript**: extends the base, for use with Typescript\n- **Typescript + React**: extends the base, for use with Typescript and React\n\nTo use this config, create an `.eslintrc` file in the root of your package and reference one of the mentioned config options.\n\n### Base `.eslintrc`\n\n```json\n{\n  \"extends\": [\"@mrmartineau/scripts/eslint\"]\n}\n```\n\n### React `.eslintrc`\n\n```json\n{\n  \"extends\": [\"@mrmartineau/scripts/eslint/react\"]\n}\n```\n\n### Typescript `.eslintrc`\n\n```json\n{\n  \"extends\": [\"@mrmartineau/scripts/eslint/typescript\"]\n}\n```\n\n### Typescript and React `.eslintrc`\n\n```json\n{\n  \"extends\": [\"@mrmartineau/scripts/eslint/typescript-react\"]\n}\n```\n\n## Jest\n\nThis config assumes you're using jest, more specifically, that you use `ts-jest`.\n\nTo use this config, create an `jest.config.js` file in the root of your package and add:\n\n#### Using the default config\n\n```js\nmodule.exports = require('@mrmartineau/scripts/jest')\n```\n\n#### Overriding the default config\n\nIf you need to add or override this config, use this:\n\n```js\nconst jestConfig = require('@mrmartineau/scripts/jest')\n\nmodule.exports = Object.assign(jestConfig, {\n  // your overrides here\n  testPathIgnorePatterns: ['/dist/', '/node_modules/']\n})\n```\n\n### Jest + Typescript\n\n```js\nmodule.exports = require('@mrmartineau/scripts/jest/typescript')\n```\n\n## Prettier\n\nTo use this config, create an `.prettierrc.js` file in the root of your package and add:\n\n```js\nmodule.exports = require('@mrmartineau/scripts/prettier')\n```\n\n## Rollup\n\nAt the moment, this config only provides the Rollup plugins that your package should use. See how it is used below:\n\nTo use this config, create an `rollup.config.js` file in the root of your package and add:\n\n```js\nimport { plugins } from '@mrmartineau/scripts/rollup'\n\nimport pkg from './package.json'\n\nexport default {\n  input: 'src/index.ts',\n  output: [\n    {\n      file: pkg.main,\n      format: 'cjs',\n      exports: 'named',\n      sourcemap: true\n    },\n    {\n      file: pkg.module,\n      format: 'esm',\n      exports: 'named',\n      sourcemap: true\n    }\n  ],\n\n  plugins\n}\n```\n\n### Add extra Rollup plugins\n\n```js\nimport { plugins } from '@mrmartineau/scripts/rollup'\nimport pkg from './package.json'\n\n// Add this plugin\nlet graph = require('rollup-plugin-graph')\nlet graphOptions = { prune: true }\n\nconst newPlugins = plugins.push(graph(graphOptions))\n\nexport default {\n  input: 'src/index.ts',\n  output: [\n    {\n      file: pkg.main,\n      format: 'cjs',\n      exports: 'named',\n      sourcemap: true\n    },\n    {\n      file: pkg.module,\n      format: 'esm',\n      exports: 'named',\n      sourcemap: true\n    }\n  ],\n\n  plugins: newPlugins\n}\n```\n\n## Stylelint\n\nTo use this config, create an `stylelint.config.js` file in the root of your package and add:\n\n```js\nmodule.exports = require('@mrmartineau/scripts/stylelint')\n```\n\n## TSLint\n\nThere are two types of tslint configs available for use:\n\n- **Base**: for general purpose usage\n- **React**: enhanced for tslint, extends from the base one\n\nTo use this configuration you need to create a `tslint.json` file in the root of your package and reference one of the mentioned config options.\n\n### Base `tslint.json`\n\n```json\n{\n  \"extends\": [\"@mrmartineau/scripts/tslint/base\"]\n}\n```\n\n### React `tslint.json`\n\n```json\n{\n  \"extends\": [\"@mrmartineau/scripts/tslint/react\"]\n}\n```\n\n## TypeScript\n\n`tsconfig.json` allows extensions via the `extends` key, but doesn't support module resolution (i.e. a node module), thus making it quite restrictive when it comes to referencing the path to a parent config file. Paths specified must be relative or absolute, absolute paths being of no use to us in the context of a shared code base.\n\nImporting the shared config from `./node_modules/@mrmartineau/scripts` is our only option.\n\n#### Single package repo\n\nTo use this config, create an `tsconfig.js` file in the root of your repo and add:\n\n```json\n{\n  \"extends\": \"./node_modules/@mrmartineau/scripts/tsconfig/tsconfig.base.json\",\n  ...\n}\n```\n\n### Mono repo\n\nTo use this config, create an `tsconfig.js` file in the root of your specific package (e.g. `./packages/?`) and add:\n\n```json\n{\n  \"extends\": \"../../node_modules/@mrmartineau/scripts/tsconfig/tsconfig.base.json\",\n  ...\n}\n```\n\n\u003e Made by [ZΛNDΞR ⚡](https://github.com/mrmartineau/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmartineau%2Fscripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrmartineau%2Fscripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmartineau%2Fscripts/lists"}