{"id":20842863,"url":"https://github.com/leopoldthecoder/doctor-jones-loader","last_synced_at":"2025-10-27T17:05:52.991Z","repository":{"id":37733948,"uuid":"166521575","full_name":"Leopoldthecoder/doctor-jones-loader","owner":"Leopoldthecoder","description":"webpack loader for doctor-jones","archived":false,"fork":false,"pushed_at":"2022-12-03T14:33:33.000Z","size":728,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T22:42:01.262Z","etag":null,"topics":[],"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/Leopoldthecoder.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}},"created_at":"2019-01-19T07:58:12.000Z","updated_at":"2022-11-15T12:37:03.000Z","dependencies_parsed_at":"2023-01-22T18:45:07.258Z","dependency_job_id":null,"html_url":"https://github.com/Leopoldthecoder/doctor-jones-loader","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leopoldthecoder%2Fdoctor-jones-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leopoldthecoder%2Fdoctor-jones-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leopoldthecoder%2Fdoctor-jones-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leopoldthecoder%2Fdoctor-jones-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Leopoldthecoder","download_url":"https://codeload.github.com/Leopoldthecoder/doctor-jones-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160727,"owners_count":21863624,"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-18T01:25:47.670Z","updated_at":"2025-10-27T17:05:52.897Z","avatar_url":"https://github.com/Leopoldthecoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# doctor-jones-loader\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://app.codacy.com/app/Leopoldthecoder/doctor-jones-loader?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=Leopoldthecoder/doctor-jones-loader\u0026utm_campaign=Badge_Grade_Dashboard'\u003e\u003cimg src='https://img.shields.io/codacy/grade/cd461cedec7f4609870bb5d94439e286.svg?style=for-the-badge' alt='Codacy grade' /\u003e\u003c/a\u003e\n  \u003ca href='https://github.com/Leopoldthecoder/doctor-jones/blob/master/LICENSE'\u003e\u003cimg src='https://img.shields.io/npm/l/doctor-jones.svg?style=for-the-badge' alt='Liscense' /\u003e\u003c/a\u003e\n  \u003ca href='https://github.com/Leopoldthecoder'\u003e\u003cimg src='https://img.shields.io/badge/made%20with-%E2%9D%A4-ff69b4.svg?style=for-the-badge' alt='love' /\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cspan\u003eLinks\u003c/span\u003e\n  \u003cbr\u003e\n  \u003ca href='https://www.npmjs.com/package/doctor-jones-loader'\u003enpm Page\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cspan\u003eRelated Projects\u003c/span\u003e\n  \u003cbr\u003e\n  \u003ca href='https://github.com/Leopoldthecoder/doctor-jones'\u003edoctor-jones\u003c/a\u003e\n  \u003cspan\u003e · \u003c/span\u003e\n  \u003cspan\u003eTo Be Developed...\u003c/span\u003e\n\u003c/p\u003e\n\n### Introduction\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"70%\" src=\"https://user-images.githubusercontent.com/10095631/51251905-5e293c80-19d5-11e9-8332-80c86b8ea671.gif\"\u003e\n\u003c/p\u003e\n\nThis is a webpack loader for [doctor-jones](https://github.com/Leopoldthecoder/doctor-jones), which formats your source code during compiling. Once configured, the following parts of your code can be formatted:\n- string literals\n- template strings\n- JSX templates\n- templates in .vue SFCs\n- scripts in .vue SFCs\n\nDon't worry if you're writing TypeScript, we've also got you covered.\n\n### Installation\n\n```bash\nnpm i doctor-jones-loader -D\n```\n\n### Configuration\n\nThe simplest example is:\n```js\n// webpack.config.js\nmodule.exports = {\n  //...\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: [\n          {\n            loader: 'doctor-jones-loader'\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nTo pass format options for doctor-jones, use `formatOptions`. Click [here](https://github.com/Leopoldthecoder/doctor-jones#%E6%A0%BC%E5%BC%8F%E5%8C%96%E9%80%89%E9%A1%B9) to see which options doctor-jones supports.\n```js\n{\n  // ...\n  use: [\n    {\n      loader: 'doctor-jones-loader',\n      options: {\n        formatOptions: {\n          spacing: false\n        }\n      }\n    }\n  ]\n}\n```\n\nTo add JSX support (suppose you're using React):\n```js\n// webpack.config.js\nmodule.exports = {\n  //...\n  module: {\n    rules: [\n      {\n        test: /\\.jsx$/,\n        use: [\n          {\n            loader: 'doctor-jones-loader',\n            options: { formatOptions: {/* ... */} }\n          },\n          {\n            loader: 'babel-loader',\n            options: {\n              presets: ['@babel/preset-react']\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nNote that we're putting doctor-jones-loader before babel-loader. This is because the loader chain is executed in reverse order.\n\nTo add Vue support:\n```js\n// webpack.config.js\nconst VueLoaderPlugin = require('vue-loader/lib/plugin')\nmodule.exports = {\n  //...\n  module: {\n    rules: [\n      {\n        test: /\\.vue$/,\n        use: [\n          {\n            loader: 'doctor-jones-loader',\n            options: { formatOptions: {/* ... */} }\n          },\n          {\n            loader: 'vue-loader'\n          }\n        ]\n      }\n    ]\n  },\n  plugins: [\n    new VueLoaderPlugin()\n  ]\n}\n```\n\nTo add TypeScript support:\n```js\n// webpack.config.js\nmodule.exports = {\n  //...\n  module: {\n    rules: [\n      {\n        test: /\\.ts$/,\n        use: [\n          {\n            loader: 'doctor-jones-loader',\n            options: { formatOptions: {/* ... */} }\n          },\n          {\n            loader: 'ts-loader'\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Disabling formatting\nTo keep a certain line intact, you can simply add a leading comment for that line:\n```js\nconst str1 = 'doctor-jones是一个“治疗”中英文混排格式的工具'\n// doctor-jones-disabled-line\nconst str2 = 'doctor-jones是一个“治疗”中英文混排格式的工具'\n\n// str1 will be formatted while str2 will not\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleopoldthecoder%2Fdoctor-jones-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleopoldthecoder%2Fdoctor-jones-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleopoldthecoder%2Fdoctor-jones-loader/lists"}