├── .all-contributorsrc ├── .czrc ├── .dependabot └── config.yml ├── .eslintignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── Improve_Rule.md │ ├── Others.md │ ├── Rule_proposal.md │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── check-update.yml │ ├── release.yml │ └── test.yml ├── .gitignore ├── .hygen.js ├── .prettierignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── _hygen └── generate │ ├── development │ ├── eslint.ejs.t │ └── test.ejs.t │ ├── log │ ├── eslint.ejs.t │ ├── log.ejs.t │ └── test.ejs.t │ └── rule │ ├── doc.ejs.t │ ├── prompt.js │ ├── rule.ejs.t │ └── test.ejs.t ├── assets └── logo │ ├── eslint-plugin-gridsome.png │ └── eslint-plugin-gridsome.svg ├── docs ├── .vuepress │ ├── config.js │ └── public │ │ ├── eslint-plugin-gridsome.svg │ │ └── favicon.png ├── README.md ├── developer-guide │ └── README.md ├── introduction │ └── README.md ├── rules │ ├── README.md │ ├── format-query-block.md │ ├── require-g-image-src.md │ ├── require-g-link-to.md │ └── use-env-prefix.md └── user-guide │ └── README.md ├── lib ├── configs.ts ├── configs │ ├── base.ts │ └── recommended.ts ├── index.ts ├── rules.ts ├── rules │ ├── format-query-block.ts │ ├── require-g-image-src.ts │ ├── require-g-link-to.ts │ └── use-env-prefix.ts └── utils │ ├── attribute.ts │ ├── create-rule.ts │ ├── directive.ts │ ├── env.ts │ ├── get-code-wrap-indent-info.ts │ ├── get-prettier-option.ts │ ├── index.ts │ ├── parser-services.ts │ ├── path.ts │ ├── rule-creator.ts │ └── types │ ├── Node.ts │ ├── Parser.ts │ ├── Prettier.ts │ ├── Rule.ts │ └── index.ts ├── package-lock.json ├── package.json ├── tests ├── lib │ ├── rules │ │ ├── fixtures │ │ │ ├── format-query-block │ │ │ │ ├── invalid │ │ │ │ │ ├── 01 │ │ │ │ │ │ ├── code.vue │ │ │ │ │ │ └── output.vue │ │ │ │ │ ├── 02 │ │ │ │ │ │ ├── code.vue │ │ │ │ │ │ └── output.vue │ │ │ │ │ ├── 03 │ │ │ │ │ │ ├── code.vue │ │ │ │ │ │ └── output.vue │ │ │ │ │ └── 04 │ │ │ │ │ │ ├── code.vue │ │ │ │ │ │ └── output.vue │ │ │ │ └── valid │ │ │ │ │ ├── 01 │ │ │ │ │ └── code.vue │ │ │ │ │ ├── 02 │ │ │ │ │ └── code.vue │ │ │ │ │ └── 03 │ │ │ │ │ └── code.vue │ │ │ └── use-env-prefix │ │ │ │ ├── invalid │ │ │ │ ├── 01 │ │ │ │ │ ├── .env │ │ │ │ │ └── code.vue │ │ │ │ └── 02 │ │ │ │ │ ├── .env │ │ │ │ │ └── client.js │ │ │ │ └── valid │ │ │ │ ├── 01 │ │ │ │ ├── .env │ │ │ │ └── code.vue │ │ │ │ ├── 02 │ │ │ │ ├── .env │ │ │ │ └── client.js │ │ │ │ └── 03 │ │ │ │ └── client.js │ │ ├── format-query-block.spec.ts │ │ ├── require-g-image-src.spec.ts │ │ ├── require-g-link-to.spec.ts │ │ └── use-env-prefix.spec.ts │ └── utils │ │ ├── env.spec.ts │ │ ├── fixtures │ │ ├── get-code-wrap-indent-info │ │ │ ├── not-use-prettierrc │ │ │ │ └── file.vue │ │ │ ├── override-prettier-option │ │ │ │ ├── not-use-prettierrc │ │ │ │ │ └── file.vue │ │ │ │ └── use-prettierrc │ │ │ │ │ ├── .prettierrc │ │ │ │ │ └── file.vue │ │ │ └── use-prettierrc │ │ │ │ ├── set-other-option │ │ │ │ ├── .prettierrc │ │ │ │ └── file.vue │ │ │ │ ├── set-tab-width │ │ │ │ ├── .prettierrc │ │ │ │ └── file.vue │ │ │ │ └── set-use-tabs │ │ │ │ ├── .prettierrc │ │ │ │ └── file.vue │ │ └── get-prettier-option │ │ │ ├── not-use-prettierrc │ │ │ └── file.vue │ │ │ └── use-prettierrc │ │ │ ├── .prettierrc │ │ │ └── file.vue │ │ ├── get-code-wrap-indent-info.spec.ts │ │ ├── get-prettier-option.spec.ts │ │ └── path.spec.ts └── util │ ├── index.ts │ ├── load-fixture-creator.ts │ └── rule-tester.ts ├── tools ├── update-rules-docs.ts ├── update-rules-list.ts ├── update.ts └── util │ ├── const.ts │ ├── create-rules-docs.ts │ ├── create-rules-list.ts │ ├── format-markdown.ts │ ├── format-typescript.ts │ ├── get-rules-meta-data.ts │ ├── index.ts │ └── types.ts ├── tsconfig.build.json └── tsconfig.json /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "eslint-plugin-gridsome", 3 | "projectOwner": "gridsome", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "files": [ 7 | "README.md" 8 | ], 9 | "imageSize": 100, 10 | "commit": true, 11 | "commitConvention": "angular", 12 | "badgeTemplate": "\"All-orange.svg\">", 13 | "contributors": [ 14 | { 15 | "login": "tyankatsu0105", 16 | "name": "tyankatsu", 17 | "avatar_url": "https://avatars0.githubusercontent.com/u/28397593?v=4", 18 | "profile": "https://tyankatsu.netlify.com/", 19 | "contributions": [ 20 | "code", 21 | "doc", 22 | "maintenance", 23 | "test" 24 | ] 25 | }, 26 | { 27 | "login": "hacknug", 28 | "name": "Nestor Vera", 29 | "avatar_url": "https://avatars0.githubusercontent.com/u/1107521?v=4", 30 | "profile": "https://www.nestor.rip", 31 | "contributions": [ 32 | "bug", 33 | "ideas" 34 | ] 35 | } 36 | ], 37 | "contributorsPerLine": 7 38 | } 39 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "cz-conventional-changelog" 3 | } 4 | -------------------------------------------------------------------------------- /.dependabot/config.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | 3 | update_configs: 4 | - package_manager: 'javascript' 5 | directory: '/' 6 | update_schedule: 'weekly' 7 | target_branch: 'master' 8 | default_reviewers: 9 | - 'tyankatsu0105' 10 | default_assignees: 11 | - 'tyankatsu0105' 12 | default_labels: 13 | - '🤖dependencies' -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | log/**/* 3 | tools/update-readme/_readme/* 4 | fixtures 5 | lib/**/*.js -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type import('eslint').Linter.BaseConfig */ 2 | module.exports = { 3 | parserOptions: { 4 | ecmaVersion: 2017, 5 | sourceType: "module", 6 | }, 7 | parser: "@typescript-eslint/parser", 8 | env: { 9 | node: true, 10 | }, 11 | 12 | extends: [ 13 | "eslint:recommended", 14 | "plugin:@typescript-eslint/recommended", 15 | "prettier", 16 | ], 17 | plugins: ["prettier"], 18 | rules: { 19 | "prettier/prettier": "error", 20 | "func-style": ["error", "expression"], 21 | "@typescript-eslint/explicit-module-boundary-types": "off", 22 | "@typescript-eslint/ban-types": "off", 23 | "@typescript-eslint/no-explicit-any": "off", 24 | "no-irregular-whitespace": ["error", { 25 | "skipRegExps": true 26 | }] 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Improve_Rule.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Improve Rule 3 | about: Suggest an idea for a exist rule 4 | --- 5 | 6 | **Please write rule name what you want to improve:** 7 | 8 | 9 | 10 | **How are the rules improved?:** 11 | 12 | **Provide 2-3 code examples that this rule should warn about:** 13 | 14 | ```vue 15 | 16 | ``` 17 | 18 | **Additional context** 19 | 20 | 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Others.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Others 3 | about: Others 4 | --- 5 | 6 | 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Rule_proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Rule Proposal 3 | about: Suggest an idea for a new rule 4 | --- 5 | 6 | 11 | 12 | **Please describe what the rule should do:** 13 | 14 | 15 | 16 | **What category should the rule belong to?** 17 | 18 | 19 | 20 | - [ ] Enforces code style 21 | - [ ] Warns about a potential error 22 | - [ ] Suggests an alternate way of doing something 23 | - [ ] Other (please specify:) 24 | 25 | **Provide 2-3 code examples that this rule should warn about:** 26 | 27 | ```vue 28 | 29 | ``` 30 | 31 | **Additional context** 32 | 33 | 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | --- 5 | 6 | 11 | 12 | **Tell us about your environment** 13 | 14 | - **ESLint version:** 15 | - **eslint-plugin-gridsome version:** 16 | - **Node version:** 17 | 18 | **Please show your full configuration:** 19 | 20 | 21 | 22 | ```json 23 | 24 | ``` 25 | 26 | **What did you do?** 27 | 28 | 29 | 30 | ```vue 31 | 32 | ``` 33 | 34 | **What did you expect to happen?** 35 | 36 | **What actually happened?** 37 | 38 | 39 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Check 4 | 5 | - [ ] Pass the rule's test. : `npm run test` 6 | - [ ] Fill the rule's docs. 7 | - [ ] Create files by Hygen. : `npm run gen:rule` 8 | 9 | 10 | 11 | # What 12 | 13 | # Related issue 14 | -------------------------------------------------------------------------------- /.github/workflows/check-update.yml: -------------------------------------------------------------------------------- 1 | name: Check Update 2 | 3 | on: push 4 | 5 | jobs: 6 | checkDocs: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | 12 | - uses: actions/cache@v1 13 | id: cache 14 | with: 15 | path: node_modules 16 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 17 | restore-keys: | 18 | ${{ runner.os }}-npm- 19 | - name: Use Node.js 12 20 | uses: actions/setup-node@v1 21 | with: 22 | registry-url: "https://registry.npmjs.org" 23 | node-version: '12.x' 24 | 25 | - name: Install dependencies 26 | if: steps.cache.outputs.cache-hit != 'true' 27 | run: npm ci 28 | 29 | - name: Update Rules Docs 30 | run: npm run update 31 | 32 | - name: Check diff 33 | id: check-diff 34 | run: | 35 | echo ::set-output name=diff-files::$(git diff --diff-filter=AM --name-only) 36 | 37 | - name: Report 38 | if: steps.check-diff.outputs.diff-files 39 | uses: mshick/add-pr-comment@v1 40 | with: 41 | message: | 42 | Please run `npm run update` 43 | repo-token: ${{ secrets.GITHUB_TOKEN }} 44 | allow-repeats: 'true' 45 | 46 | - name: Exit 47 | if: steps.check-diff.outputs.diff-files 48 | run: exit 1 49 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | pull_request: 4 | types: 5 | - closed 6 | jobs: 7 | release: 8 | name: Release 9 | runs-on: ubuntu-latest 10 | if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v') 11 | steps: 12 | - uses: actions/checkout@v2 13 | with: 14 | ref: master 15 | fetch-depth: 0 16 | 17 | - uses: actions/cache@v2 18 | id: cache 19 | with: 20 | path: node_modules 21 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 22 | restore-keys: | 23 | ${{ runner.os }}-npm- 24 | - name: Use Node.js 12 25 | uses: actions/setup-node@v1 26 | with: 27 | registry-url: 'https://registry.npmjs.org' 28 | node-version: '12.x' 29 | 30 | - name: Install dependencies 31 | if: steps.cache.outputs.cache-hit != 'true' 32 | run: npm ci 33 | 34 | - run: npx shipjs trigger 35 | env: 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Rules Test 2 | 3 | on: push 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | # Test with Node.js v10 (LTS), v12 (LTS), v13, and v14 (latest) 12 | node-version: [10.x, 12.x, 13.x, 14.x] 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - uses: actions/cache@v1 18 | id: cache 19 | with: 20 | path: node_modules 21 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 22 | restore-keys: | 23 | ${{ runner.os }}-npm- 24 | 25 | - name: Use Node.js ${{ matrix.node-version }} 26 | uses: actions/setup-node@v1 27 | with: 28 | node-version: ${{ matrix.node-version }} 29 | 30 | - name: Install dependencies 31 | if: steps.cache.outputs.cache-hit != 'true' 32 | run: npm ci 33 | 34 | - name: Test 35 | run: npm run test 36 | 37 | - name: Typecheck 38 | run: npm run typecheck 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig 2 | 3 | # Created by https://www.gitignore.io/api/macos,visualstudiocode,node 4 | # Edit at https://www.gitignore.io/?templates=macos,visualstudiocode,node 5 | 6 | ### macOS ### 7 | # General 8 | .DS_Store 9 | .AppleDouble 10 | .LSOverride 11 | 12 | # Icon must end with two \r 13 | Icon 14 | 15 | # Thumbnails 16 | ._* 17 | 18 | # Files that might appear in the root of a volume 19 | .DocumentRevisions-V100 20 | .fseventsd 21 | .Spotlight-V100 22 | .TemporaryItems 23 | .Trashes 24 | .VolumeIcon.icns 25 | .com.apple.timemachine.donotpresent 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | 34 | ### Node ### 35 | # Logs 36 | logs 37 | *.log 38 | npm-debug.log* 39 | yarn-debug.log* 40 | yarn-error.log* 41 | 42 | # Runtime data 43 | pids 44 | *.pid 45 | *.seed 46 | *.pid.lock 47 | 48 | # Directory for instrumented libs generated by jscoverage/JSCover 49 | lib-cov 50 | 51 | # Coverage directory used by tools like istanbul 52 | coverage 53 | 54 | # nyc test coverage 55 | .nyc_output 56 | 57 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 58 | .grunt 59 | 60 | # Bower dependency directory (https://bower.io/) 61 | bower_components 62 | 63 | # node-waf configuration 64 | .lock-wscript 65 | 66 | # Compiled binary addons (https://nodejs.org/api/addons.html) 67 | build/Release 68 | 69 | # Dependency directories 70 | node_modules/ 71 | jspm_packages/ 72 | 73 | # TypeScript v1 declaration files 74 | typings/ 75 | 76 | # Optional npm cache directory 77 | .npm 78 | 79 | # Optional eslint cache 80 | .eslintcache 81 | 82 | # Optional REPL history 83 | .node_repl_history 84 | 85 | # Output of 'npm pack' 86 | *.tgz 87 | 88 | # Yarn Integrity file 89 | .yarn-integrity 90 | 91 | # dotenv environment variables file 92 | /.env 93 | 94 | # parcel-bundler cache (https://parceljs.org/) 95 | .cache 96 | 97 | # next.js build output 98 | .next 99 | 100 | # nuxt.js build output 101 | .nuxt 102 | 103 | # vuepress build output 104 | .vuepress/dist 105 | 106 | # Serverless directories 107 | .serverless 108 | 109 | # FuseBox cache 110 | .fusebox/ 111 | 112 | ### VisualStudioCode ### 113 | .vscode/* 114 | !.vscode/settings.json 115 | !.vscode/tasks.json 116 | !.vscode/launch.json 117 | !.vscode/extensions.json 118 | 119 | ### VisualStudioCode Patch ### 120 | # Ignore all local history of files 121 | .history 122 | 123 | # End of https://www.gitignore.io/api/macos,visualstudiocode,node 124 | 125 | # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) 126 | 127 | .node-version 128 | /log 129 | .vscode 130 | .tool-versions 131 | /development 132 | !/development/.gitkeep 133 | dist -------------------------------------------------------------------------------- /.hygen.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | templates: `${__dirname}/_hygen`, 3 | }; 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | tools/update-readme/_* -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.6.2](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.6.1...v1.6.2) (2021-02-13) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **use-env-prefix:** consider that env file does not exist ([#119](https://github.com/gridsome/eslint-plugin-gridsome/issues/119)) ([6cd3b45](https://github.com/gridsome/eslint-plugin-gridsome/commit/6cd3b4586593a1e6e1abbed93d4cf52cf6eb0f33)) 7 | 8 | 9 | 10 | ## [1.6.1](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.6.0...v1.6.1) (2021-01-17) 11 | 12 | 13 | ### Bug Fixes 14 | 15 | * **use-env-prefix:** fix around treating filename ([#117](https://github.com/gridsome/eslint-plugin-gridsome/issues/117)) ([d25d1ae](https://github.com/gridsome/eslint-plugin-gridsome/commit/d25d1aea2e5c11e56ef871a1fd2b89ddbe849e7e)), closes [#116](https://github.com/gridsome/eslint-plugin-gridsome/issues/116) 16 | 17 | 18 | 19 | # [1.6.0](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.5.2...v1.6.0) (2021-01-17) 20 | 21 | 22 | ### Features 23 | 24 | * add `use-env-prefix` rules ([#113](https://github.com/gridsome/eslint-plugin-gridsome/issues/113)) ([134ab7e](https://github.com/gridsome/eslint-plugin-gridsome/commit/134ab7ea87031af349f829a906fa4541f88d1af4)) 25 | 26 | 27 | 28 | ## [1.5.2](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.5.1...v1.5.2) (2020-12-22) 29 | 30 | 31 | 32 | ## [1.5.1](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.5.0...v1.5.1) (2020-12-22) 33 | 34 | 35 | 36 | # [1.5.0](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.13...v1.5.0) (2020-07-05) 37 | 38 | 39 | ### Features 40 | 41 | * **format-query-block:** add option overridePrettierOption ([#104](https://github.com/gridsome/eslint-plugin-gridsome/issues/104)) ([1110fa7](https://github.com/gridsome/eslint-plugin-gridsome/commit/1110fa796d1d934b00c91b37037960f70df252eb)), closes [#60](https://github.com/gridsome/eslint-plugin-gridsome/issues/60) 42 | 43 | 44 | 45 | ## [1.4.13](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.12...v1.4.13) (2020-06-23) 46 | 47 | 48 | ### Features 49 | 50 | * follow ESLint v7 ([59eb4fa](https://github.com/gridsome/eslint-plugin-gridsome/commit/59eb4fada38fea400201051f3551593ce0eac757)) 51 | 52 | 53 | 54 | ## [1.4.12](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.11...v1.4.12) (2020-05-22) 55 | 56 | 57 | 58 | ## [1.4.11](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.9...v1.4.11) (2020-05-13) 59 | 60 | 61 | 62 | ## [1.4.10](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.9...v1.4.10) (2020-05-08) 63 | 64 | 65 | 66 | ## [1.4.9](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.9) (2020-04-26) 67 | 68 | 69 | 70 | ## [1.4.8](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.8) (2020-04-25) 71 | 72 | 73 | 74 | ## [1.4.7](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.7) (2020-04-25) 75 | 76 | 77 | 78 | ## [1.4.6](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.6) (2020-04-25) 79 | 80 | 81 | 82 | ## [1.4.5](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.5) (2020-04-25) 83 | 84 | 85 | 86 | ## [1.4.4](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.4) (2020-04-25) 87 | 88 | 89 | 90 | ## [1.4.3](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.3) (2020-04-25) 91 | 92 | 93 | 94 | ## [1.4.2](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.1...v1.4.2) (2020-04-25) 95 | 96 | 97 | 98 | #### 1.4.1 (2020-03-08) 99 | 100 | ##### Build System / Dependencies 101 | 102 | * **node engine:** update node engine to v10.13.0 ([#50](https://github.com/gridsome/eslint-plugin-gridsome/pull/50)) ([45395586](https://github.com/gridsome/eslint-plugin-gridsome/commit/45395586e812167f1c1eb7e9c02d4e4a86b2b9ff)) 103 | * Upgrade ESLint v6 ([#47](https://github.com/gridsome/eslint-plugin-gridsome/pull/47)) ([0a0e3900](https://github.com/gridsome/eslint-plugin-gridsome/commit/0a0e3900a655e93f7a4fd2422ed104c1ca5ebe86)) 104 | 105 | ##### Chores 106 | 107 | * add all-contributors-cli ([#52](https://github.com/gridsome/eslint-plugin-gridsome/pull/52)) ([5db85f02](https://github.com/gridsome/eslint-plugin-gridsome/commit/5db85f02e95240d2e3d133e9a36138242e3637f1)) 108 | 109 | ##### Documentation Changes 110 | 111 | * add @hacknug as a contributor ([#54](https://github.com/gridsome/eslint-plugin-gridsome/pull/54)) ([cd9c8ced](https://github.com/gridsome/eslint-plugin-gridsome/commit/cd9c8ced8422da0e3014108b663dc87a287328d0)) 112 | 113 | ##### New Features 114 | 115 | * Support break line ([#58](https://github.com/gridsome/eslint-plugin-gridsome/pull/58)) ([b2ea54c0](https://github.com/gridsome/eslint-plugin-gridsome/commit/b2ea54c091d0fa46d41a38f9f5d1f2625ddec3df)) 116 | * **website:** Add docs site with vuepress ([#51](https://github.com/gridsome/eslint-plugin-gridsome/pull/51)) ([c50b84c6](https://github.com/gridsome/eslint-plugin-gridsome/commit/c50b84c6a47383ed7083827d2beee1124f24fdce)) 117 | 118 | ### 1.4.0 (2019-11-03) 119 | 120 | ##### Chores 121 | 122 | * add development directory ([#41](https://github.com/gridsome/eslint-plugin-gridsome/pull/41)) ([6d558f98](https://github.com/gridsome/eslint-plugin-gridsome/commit/6d558f985d745a2356e1662afeb73fc90b28d966)) 123 | 124 | ##### Other Changes 125 | 126 | * **format-query-block:** add baseIndent option ([#42](https://github.com/gridsome/eslint-plugin-gridsome/pull/42)) ([d053d75f](https://github.com/gridsome/eslint-plugin-gridsome/commit/d053d75ffb438791dd9faab3b48de2b6f83bee5a)) 127 | 128 | #### 1.3.2 (2019-09-29) 129 | 130 | ##### Build System / Dependencies 131 | 132 | * remove yarn ([#37](https://github.com/gridsome/eslint-plugin-gridsome/pull/37)) ([354c0cfb](https://github.com/gridsome/eslint-plugin-gridsome/commit/354c0cfb86cd24863f422f33e85cbf424e36d483)) 133 | 134 | ##### Documentation Changes 135 | 136 | * **CHANGELOG.md:** 137 | * :bookmark: updated CHANGELOG.md ([30434a06](https://github.com/gridsome/eslint-plugin-gridsome/commit/30434a06de235ecd1d04cef44ee6de4c72710172)) 138 | * :bookmark: updated CHANGELOG.md ([7a726e71](https://github.com/gridsome/eslint-plugin-gridsome/commit/7a726e71eff88392e0748f17148d950cff33be51)) 139 | 140 | ##### Other Changes 141 | 142 | * gridsome/eslint-plugin-gridsome ([9d6b0960](https://github.com/gridsome/eslint-plugin-gridsome/commit/9d6b096057b11f2919972c96dcbf3d58e89da88b)) 143 | * updated version ([4216aecb](https://github.com/gridsome/eslint-plugin-gridsome/commit/4216aecbd843f68383fdba009a46191a13071f46)) 144 | 145 | #### 1.3.1 (2019-09-29) 146 | 147 | ##### Build System / Dependencies 148 | 149 | * remove yarn ([#37](https://github.com/gridsome/eslint-plugin-gridsome/pull/37)) ([354c0cfb](https://github.com/gridsome/eslint-plugin-gridsome/commit/354c0cfb86cd24863f422f33e85cbf424e36d483)) 150 | 151 | ##### Documentation Changes 152 | 153 | * **CHANGELOG.md:** :bookmark: updated CHANGELOG.md ([7a726e71](https://github.com/gridsome/eslint-plugin-gridsome/commit/7a726e71eff88392e0748f17148d950cff33be51)) 154 | 155 | ##### Other Changes 156 | 157 | * updated version ([4216aecb](https://github.com/gridsome/eslint-plugin-gridsome/commit/4216aecbd843f68383fdba009a46191a13071f46)) 158 | 159 | ### 1.3.0 (2019-09-15) 160 | 161 | ##### Refactors 162 | 163 | - refactor g-link consider href ([#35](https://github.com/gridsome/eslint-plugin-gridsome/pull/35)) ([2eec64b5](https://github.com/gridsome/eslint-plugin-gridsome/commit/2eec64b59ac6315a0ba9e09c42d00986b37e0360)) 164 | 165 | #### 1.2.9 (2019-09-15) 166 | 167 | ##### Build System / Dependencies 168 | 169 | - **deps:** 170 | - bump js-yaml from 3.12.1 to 3.13.1 ([#17](https://github.com/gridsome/eslint-plugin-gridsome/pull/17)) ([c4c95ea9](https://github.com/gridsome/eslint-plugin-gridsome/commit/c4c95ea997816d83d1359f46a7c766feed3510fd)) 171 | - bump mixin-deep from 1.3.1 to 1.3.2 ([#23](https://github.com/gridsome/eslint-plugin-gridsome/pull/23)) ([9b324cc9](https://github.com/gridsome/eslint-plugin-gridsome/commit/9b324cc9bf2400b803c1d6f201ef2a3eb6a1faf2)) 172 | - bump eslint-utils from 1.3.1 to 1.4.2 ([#22](https://github.com/gridsome/eslint-plugin-gridsome/pull/22)) ([4aa96f6c](https://github.com/gridsome/eslint-plugin-gridsome/commit/4aa96f6c64e4f8b9c328276fdc8588df6257b2d7)) 173 | - upgrade packages version ([#32](https://github.com/gridsome/eslint-plugin-gridsome/pull/32)) ([a8420ff7](https://github.com/gridsome/eslint-plugin-gridsome/commit/a8420ff75802bd3c05ac70258750d8b3c35857d0)) 174 | 175 | ##### Chores 176 | 177 | - remove fixture ([#30](https://github.com/gridsome/eslint-plugin-gridsome/pull/30)) ([a151708a](https://github.com/gridsome/eslint-plugin-gridsome/commit/a151708af977e74528cd52e3f60f2bb344bc5f20)) 178 | 179 | ##### Continuous Integration 180 | 181 | - refacotr travis.yml ([#29](https://github.com/gridsome/eslint-plugin-gridsome/pull/29)) ([1bee3712](https://github.com/gridsome/eslint-plugin-gridsome/commit/1bee3712d28ca2f12dcfe9174824ed3c41b3e839)) 182 | 183 | ##### Documentation Changes 184 | 185 | - reverse correct and incorrect example ([#33](https://github.com/gridsome/eslint-plugin-gridsome/pull/33)) ([37736527](https://github.com/gridsome/eslint-plugin-gridsome/commit/37736527b3fb7d8d12e49d15fe8bbba4adb8331d)) 186 | - fix others issue template ([cdd16edf](https://github.com/gridsome/eslint-plugin-gridsome/commit/cdd16edf1fc6c6c590137ed66bee71b6151088f0)) 187 | - Add issue template ([#25](https://github.com/gridsome/eslint-plugin-gridsome/pull/25)) ([01d48038](https://github.com/gridsome/eslint-plugin-gridsome/commit/01d48038bad09c838fb08f72e7f7a7add11c11fe)) 188 | 189 | #### 1.2.8 (2019-08-06) 190 | 191 | ##### Build System / Dependencies 192 | 193 | - downgrade eslint from ^6.1.0 ([b80a0988](https://github.com/gridsome/eslint-plugin-gridsome/commit/b80a0988e4f466157f084498e31e6f7c2ebb2c8f)) 194 | - **deps:** bump lodash from 4.17.11 to 4.17.14 ([#20](https://github.com/gridsome/eslint-plugin-gridsome/pull/20)) ([e2d4098a](https://github.com/gridsome/eslint-plugin-gridsome/commit/e2d4098a13bed8ad2624b0a267076eff20eca548)) 195 | 196 | #### 1.2.7 (2019-08-04) 197 | 198 | ##### Build System / Dependencies 199 | 200 | - upgrade dependence packages ([80eb3ada](https://github.com/gridsome/eslint-plugin-gridsome/commit/80eb3ada73b6409c24557d50ad8c9cccb01009c1)) 201 | 202 | ##### Documentation Changes 203 | 204 | - Add tips about vue-eslint-parser version ([#19](https://github.com/gridsome/eslint-plugin-gridsome/pull/19)) ([a77762c6](https://github.com/gridsome/eslint-plugin-gridsome/commit/a77762c657ffdeb73448baf479867ea771b6dd76)) 205 | 206 | #### 1.2.6 (2019-06-10) 207 | 208 | ##### Build System / Dependencies 209 | 210 | - Upgrade packages ([#18](https://github.com/gridsome/eslint-plugin-gridsome/pull/18)) ([c2f24932](https://github.com/gridsome/eslint-plugin-gridsome/commit/c2f249320704ae5aadce31de7fb8fa91866744c7)) 211 | 212 | #### 1.2.5 (2019-05-11) 213 | 214 | ##### Chores 215 | 216 | - Update logo ([4c92d208](https://github.com/gridsome/eslint-plugin-gridsome/commit/4c92d208e7081012f68db6c448593a0fe46df497)) 217 | 218 | ##### Refactors 219 | 220 | - Add parserOptions item and change env node to browser ([61b5eb63](https://github.com/gridsome/eslint-plugin-gridsome/commit/61b5eb63618d3b05e176729e002728010be4a2ff)) 221 | - **configs:** Added parser option ([#14](https://github.com/gridsome/eslint-plugin-gridsome/pull/14)) ([987c200e](https://github.com/gridsome/eslint-plugin-gridsome/commit/987c200e190c5efe3188f9bb52c7ae00eccdb45a)) 222 | 223 | #### 1.2.4 (2019-05-03) 224 | 225 | ##### Chores 226 | 227 | - Update logo png and change format readme ([65b0690e](https://github.com/gridsome/eslint-plugin-gridsome/commit/65b0690e756f02d0be844318b1d5a87d4aa25c62)) 228 | 229 | #### 1.2.3 (2019-05-02) 230 | 231 | ##### New Features 232 | 233 | - Add logo for eslint-plugin-gridsome ([#13](https://github.com/gridsome/eslint-plugin-gridsome/pull/13)) ([916f6d2f](https://github.com/gridsome/eslint-plugin-gridsome/commit/916f6d2fbd4a6d8903e5920f8a36f1254527de54)) 234 | 235 | #### 1.2.2 (2019-05-01) 236 | 237 | ##### Documentation Changes 238 | 239 | - Add explain configs ([8d74bede](https://github.com/gridsome/eslint-plugin-gridsome/commit/8d74bede9329a41b1bc789b49372bb59531c259f)) 240 | 241 | ##### Refactors 242 | 243 | - Check prettier config in query-block-format ([#5](https://github.com/gridsome/eslint-plugin-gridsome/pull/5)) ([d659e273](https://github.com/gridsome/eslint-plugin-gridsome/commit/d659e273439bf243dc3343375f7f397280ee7d90)) 244 | 245 | #### 1.2.1 (2019-05-01) 246 | 247 | ##### Documentation Changes 248 | 249 | - Fix special characters ([#9](https://github.com/gridsome/eslint-plugin-gridsome/pull/9)) ([6ed5b982](https://github.com/gridsome/eslint-plugin-gridsome/commit/6ed5b982de2b4d87fcfa6ba449c0043102334fc6)) 250 | 251 | ##### New Features 252 | 253 | - Add configs ([#11](https://github.com/gridsome/eslint-plugin-gridsome/pull/11)) ([0445ee15](https://github.com/gridsome/eslint-plugin-gridsome/commit/0445ee153b32b49401de3de6c88f5068957f8a5e)) 254 | 255 | ### 1.2.0 (2019-05-01) 256 | 257 | ##### Build System / Dependencies 258 | 259 | - Upgrade package version ([5ab35312](https://github.com/gridsome/eslint-plugin-gridsome/commit/5ab353125f3fd52b99bb436192fc431d866cbdfc)) 260 | 261 | ##### Chores 262 | 263 | - remove fixpack to fix security warning ([ba57fe00](https://github.com/gridsome/eslint-plugin-gridsome/commit/ba57fe004b3ae00be972674ad1fd4c28f6cd99a0)) 264 | 265 | ##### Other Changes 266 | 267 | - Add rule require-g-link-to ([#7](https://github.com/gridsome/eslint-plugin-gridsome/pull/7)) ([bd80a026](https://github.com/gridsome/eslint-plugin-gridsome/commit/bd80a0265b83aaad4fcce0c51cfa7e48838ce058)) 268 | - Add new rule `require-g-image-src` ([#6](https://github.com/gridsome/eslint-plugin-gridsome/pull/6)) ([fa05552b](https://github.com/gridsome/eslint-plugin-gridsome/commit/fa05552b97c638754b179e636df265fa4d9cef1a)) 269 | 270 | ##### Performance Improvements 271 | 272 | - Rename npm scripts ([97048ef3](https://github.com/gridsome/eslint-plugin-gridsome/commit/97048ef370e3f1c284953663b006cf7393b319fb)) 273 | 274 | #### 1.1.1 (2019-03-03) 275 | 276 | ##### Chores 277 | 278 | - **package.json:** don’t watch default test command ([089b0f14](https://github.com/gridsome/eslint-plugin-gridsome/commit/089b0f1410b4ed1d844359d4aea2b1d81d3fb6d5)) 279 | 280 | ### 1.1.0 (2019-02-21) 281 | 282 | ##### Chores 283 | 284 | - **package.json:** Change author homepage ([085578eb](https://github.com/gridsome/eslint-plugin-gridsome/commit/085578eb5dcbeea752ebd72fff94ce1a74331de3)) 285 | 286 | ##### Documentation Changes 287 | 288 | - Update rule description format-query ([244bbd1b](https://github.com/gridsome/eslint-plugin-gridsome/commit/244bbd1b0520d8a58b5482a2139797890b8974d8)) 289 | 290 | ##### Refactors 291 | 292 | - Clean code ([8c2d5b4e](https://github.com/gridsome/eslint-plugin-gridsome/commit/8c2d5b4e6c0339a1f6d1e6b5efb9ec9182972192)) 293 | 294 | #### 1.0.1 (2018-12-11) 295 | 296 | ##### Documentation Changes 297 | 298 | - fix add ([69845049](https://github.com/gridsome/eslint-plugin-gridsome/commit/69845049bfd139992e1daf4a149bcc56eba639b4)) 299 | 300 | ## 1.0.0 (2018-12-06) 301 | 302 | ##### Documentation Changes 303 | 304 | - refactor README ([f372e6fc](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/f372e6fc6bc24c3d79a86663e348ec43e16d7c8c)) 305 | - refactor rule doc ([06d51b67](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/06d51b679e8b4baee124bc886c1ac3e37b85a372)) 306 | - roadmap status change ([5e826898](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/5e8268989bc1a69d1e5f6f7e5be026332e25737b)) 307 | - roadmap status change ([430e7377](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/430e7377607379161d3684b8f02363568baf79b1)) 308 | 309 | ##### New Features 310 | 311 | - create rule's document ([b33fe51e](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/b33fe51ea885b22a07e1bfb251b1d9a2c3202ac8)) 312 | 313 | ##### Refactors 314 | 315 | - change lint error message ([f3ad7b92](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/f3ad7b92c3437f31b896c59632010162d79c8608)) 316 | 317 | ### 0.1.0 (2018-12-02) 318 | 319 | ##### Documentation Changes 320 | 321 | - change eslint sample ([817154b8](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/817154b835fca464810c4c7231b7ead7bdb87e5c)) 322 | - add rodemap in README ([b57fd8e6](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/b57fd8e6ad334e6a2ddc15d8d41e9bcf644526d7)) 323 | - add github ISSUE_TEMPLATE ([b23aa9e5](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/b23aa9e5994cf69f526aaa7ce38f5e5d6546eee9)) 324 | 325 | ##### New Features 326 | 327 | - add fix target static-query ([a625d05a](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/a625d05a66030af4bd8388a70117b1f0af829d9a)) 328 | 329 | #### 0.0.7 (2018-12-01) 330 | 331 | ##### Documentation Changes 332 | 333 | - add status badge ([bbf1b320](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/bbf1b320874c7b1d19034f2c445c8523fe0bf7ce)) 334 | - add how to commit ([bcfca529](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/bcfca5297e76d5a2a71370018068f9a4c2684691)) 335 | 336 | ##### Refactors 337 | 338 | - update yarn.lock ([fc10e8f1](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/fc10e8f1bb4fc33e5ca5a7ddc45ca28f851e1d96)) 339 | - remove unused package ([59fc8594](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/59fc85947035a99ceaafab4c23ad73e7361b4dcc)) 340 | 341 | #### 0.0.6 (2018-12-01) 342 | 343 | ##### Refactors 344 | 345 | - add keywords ([0f77b502](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/0f77b5029370685d19eaaf0db77bea0745f90862)) 346 | 347 | #### 0.0.5 (2018-11-30) 348 | 349 | ##### Documentation Changes 350 | 351 | - refactor README.md ([3994d35d](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/3994d35d844a6358d389ff43d18a5e0dd7963976)) 352 | 353 | #### 0.0.4 (2018-11-30) 354 | 355 | ##### Bug Fixes 356 | 357 | - fix main field in package.json ([ecfece73](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/ecfece73a308eaadc7f9c5e88b2fa4e40aa1f1a0)) 358 | 359 | #### 0.0.3 (2018-11-30) 360 | 361 | ##### Documentation Changes 362 | 363 | - fix example code in README.md ([09d4beb5](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/09d4beb55913fb634ddab70e1576282fa46c143e)) 364 | 365 | #### 0.0.2 (2018-11-30) 366 | 367 | ##### Continuous Integration 368 | 369 | - fix script on travis ([bc306993](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/bc3069938fa7f805f8dcc290a67cbf41e9248597)) 370 | 371 | ##### Documentation Changes 372 | 373 | - **CHANGELOG.md:** :bookmark: updated CHANGELOG.md ([7394b001](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/7394b0011522b97633c04f30e2491b707e877b59)) 374 | 375 | ##### Code Style Changes 376 | 377 | - style package.json ([1ac6e456](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/1ac6e4561b798617f287fad1c26b11db22b514b2)) 378 | 379 | #### 0.0.2 (2018-11-30) 380 | 381 | ##### Continuous Integration 382 | 383 | - fix script on travis ([bc306993](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/bc3069938fa7f805f8dcc290a67cbf41e9248597)) 384 | 385 | #### 0.0.1 (2018-11-30) 386 | 387 | ##### Documentation Changes 388 | 389 | - add CONTRIBUTING, refactor README ([7330862b](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/7330862b2efc3c96a743e4ee1668271b3a81a978)) 390 | - add README ([9bedce05](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/9bedce05051a2478910e458f7e6bfe286c937b66)) 391 | 392 | ##### New Features 393 | 394 | - add rule page-query ([4462d0d6](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/4462d0d69187f7991cafa69099522079203a6605)) 395 | - first commit ([5986a6ef](https://github.com/tyankatsu0105/eslint-plugin-gridsome/commit/5986a6efe04cf7dc84b9b3f93d700c42b9a229c5)) 396 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | 3 | ## Generate files 4 | 5 | if you want to create a new rule, use this command. 6 | This command use [Hygen](https://www.hygen.io/). 7 | 8 | ```bash 9 | $ npm run gen:rule 10 | ``` 11 | 12 | ## Development new rule 13 | 14 | Development your awesome rule! :wrench: 15 | 16 | ### Create log file(optional) 17 | 18 | If you want to check AST, use this command. 19 | `log` folder is created by Hygen. 20 | This folder is already added that gitignore. 21 | AST is outputed to `log/log.json`. 22 | 23 | ```bash 24 | $ npm run gen:log 25 | $ npm run log 26 | ``` 27 | 28 | ## test 29 | 30 | When write your rule's test, use this command. 31 | This command watch `tests/lib/rules`. 32 | 33 | ```bash 34 | $ npm run test 35 | ``` 36 | 37 | ## commit 38 | 39 | If you want to use git commit, use this command. 40 | This command use [Commitizen](http://commitizen.github.io/cz-cli/). 41 | Commitizen's commit template is `cz-conventional-changelog` 42 | 43 | ```bash 44 | $ npm run commit 45 | ``` 46 | 47 | # development directory 48 | 49 | If you confirm rules in `lib/rules`, generate `development` directory with `npm run gen:development`. 50 | And then `npm run confirm`. 51 | 52 | # Did you contribute to eslint-plugin-gridsome❓ 53 | 54 | Great!! 55 | You can add contributors list with [allcontributors](https://allcontributors.org/). 56 | Example: 57 | 58 | ```bash 59 | npx all-contributors add tyankatsu0105 code,doc,maintenance,test 60 | ``` 61 | 62 | Then, send PR. 63 | 64 | Also check [this](https://allcontributors.org/docs/en/emoji-key). 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018-present, tyankatsu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

ESLint plugin for Gridsome

2 | 3 |

eslint-plugin-gridsome

4 |

5 | This is ESlint plugin for Gridsome. 6 |

7 |

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | All Contributors 16 | 17 | 18 | 19 | 20 |
21 |
22 |

23 | 24 | ## 📖Documentation 25 | 26 | See [the our documentation site](https://eslint.gridsome.org/). 27 | 28 | ## 💻Contributing 29 | 30 | Create GitHub issue/PR. 31 | You can see [how to contribute](https://github.com/gridsome/eslint-plugin-gridsome/blob/master/CONTRIBUTING.md). 32 | 33 | ## ✨Contributors 34 | 35 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |

tyankatsu

💻 📖 🚧 ⚠️

Nestor Vera

🐛 🤔
46 | 47 | 48 | 49 | 50 | 51 | 52 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 53 | 54 | ## 🔒License 55 | 56 | See the [LICENSE](https://github.com/gridsome/eslint-plugin-gridsome/blob/master/LICENSE) file.(MIT) 57 | -------------------------------------------------------------------------------- /_hygen/generate/development/eslint.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: development/.eslintrc.js 3 | --- 4 | module.exports = { 5 | root: true, 6 | env: { 7 | node: true, 8 | es6: true 9 | }, 10 | parser: "vue-eslint-parser", 11 | rules: { 12 | "format-query-block": 2, 13 | "require-g-image-src": 2, 14 | "require-g-link-to": 2 15 | } 16 | }; -------------------------------------------------------------------------------- /_hygen/generate/development/test.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: development/test.vue 3 | --- 4 | 11 | 12 | 13 | query Blog { 14 | allWordPressPost(limit: 5) { 15 | edges { 16 | node { 17 | id 18 | title 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /_hygen/generate/log/eslint.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: log/.eslintrc.js 3 | --- 4 | module.exports = { 5 | root: true, 6 | env: { 7 | node: true, 8 | es6: true 9 | }, 10 | parser: "vue-eslint-parser", 11 | parserOptions: { 12 | "sourceType": "module", 13 | }, 14 | rules: { 15 | log: 2 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /_hygen/generate/log/log.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: log/rules/log.js 3 | --- 4 | "use strict"; 5 | 6 | /** 7 | * Remove `parent` proeprties from the given AST. 8 | * @param {string} key The key. 9 | * @param {any} value The value of the key. 10 | * @returns {any} The value of the key to output. 11 | */ 12 | function replacer(key, value) { 13 | if (key === "parent") { 14 | return undefined; 15 | } 16 | if (key === "errors" && Array.isArray(value)) { 17 | return value.map(e => ({ 18 | message: e.message, 19 | index: e.index, 20 | lineNumber: e.lineNumber, 21 | column: e.column 22 | })); 23 | } 24 | return value; 25 | } 26 | 27 | module.exports = { 28 | create(context) { 29 | return { 30 | Program(node) { 31 | console.log(JSON.stringify(node, replacer, 2)); 32 | } 33 | }; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /_hygen/generate/log/test.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: log/tests/log.vue 3 | --- 4 | 10 | 19 | 20 | 21 | query Blog { 22 | allWordPressPost (limit: 5) { 23 | edges { 24 | node { 25 | id 26 | 27 | title 28 | } 29 | } 30 | } 31 | } 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /_hygen/generate/rule/doc.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: docs/rules/<%= name %>.md 3 | --- 4 | --- 5 | title: <%= name %> 6 | sidebarDepth: 0 7 | description: <%= description %> 8 | --- 9 | ## Rule's description is here (gridsome/<%= name %>) 10 | 11 | ## :book: Rule Details 12 | 13 | :-1: Examples of **incorrect** code for this rule: 14 | 15 | ```html 16 | Bad example 17 | ``` 18 | 19 | :+1: Examples of **correct** code for this rule: 20 | 21 | ```html 22 | Good example 23 | ``` 24 | 25 | ## :wrench: Options 26 | 27 | If this rule has option, write here. 28 | -------------------------------------------------------------------------------- /_hygen/generate/rule/prompt.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | type: "input", 4 | name: "name", 5 | message: "New rule's name is ..." 6 | }, 7 | { 8 | type: "input", 9 | name: "author", 10 | message: "This rule's author is ..." 11 | }, 12 | { 13 | type: "input", 14 | name: "description", 15 | message: "This rule's brief description is ..." 16 | } 17 | ]; 18 | -------------------------------------------------------------------------------- /_hygen/generate/rule/rule.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: lib/rules/<%= name %>.ts 3 | --- 4 | /** 5 | * @author <%= author %> 6 | * @copyright <%= new Date().getFullYear() %> <%= author %>. All rights reserved. 7 | * See LICENSE file in root directory for full license. 8 | */ 9 | 10 | import { AST } from "vue-eslint-parser"; 11 | import { createRule, defineTemplateBodyVisitor } from "../utils"; 12 | 13 | type Options = {}; 14 | 15 | const defaultOptions: [Options] = [{}]; 16 | 17 | type MessageIds = "<%= h.changeCase.camel(name) %>"; 18 | export = createRule<[Options], MessageIds>({ 19 | name: "<%= name %>", 20 | meta: { 21 | docs: { 22 | description: "<%= description %>", 23 | category: "", 24 | recommended: false, 25 | }, 26 | type: "", 27 | messages: { 28 | <%= h.changeCase.camel(name) %>: 29 | "", 30 | }, 31 | schema: [], 32 | }, 33 | defaultOptions, 34 | create(context) { 35 | return defineTemplateBodyVisitor(context, { 36 | 37 | }); 38 | }, 39 | }); 40 | -------------------------------------------------------------------------------- /_hygen/generate/rule/test.ejs.t: -------------------------------------------------------------------------------- 1 | --- 2 | to: tests/lib/rules/<%= name %>.spec.ts 3 | --- 4 | import { RuleTester } from "../../util"; 5 | 6 | import rule from "../../../lib/rules/<%= name %>"; 7 | 8 | const tester = new RuleTester({ 9 | parser: "vue-eslint-parser", 10 | parserOptions: { 11 | ecmaVersion: 2017, 12 | }, 13 | }); 14 | 15 | tester.run("<%= name %>", rule, { 16 | valid: [ 17 | ``, 18 | ], 19 | invalid: [ 20 | { 21 | code: ``, 22 | errors: [ 23 | { 24 | messageId: "<%= h.changeCase.camel(name) %>", 25 | }, 26 | ], 27 | }, 28 | ], 29 | }); 30 | -------------------------------------------------------------------------------- /assets/logo/eslint-plugin-gridsome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridsome/eslint-plugin-gridsome/9a33d8aa9e7124888a7cfd8bde62aba1dd1c723c/assets/logo/eslint-plugin-gridsome.png -------------------------------------------------------------------------------- /assets/logo/eslint-plugin-gridsome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | const { rules } = require("../../dist/lib"); 2 | 3 | module.exports = { 4 | title: "eslint-plugin-gridsome", 5 | description: "ESLint plugin for Gridsome", 6 | evergreen: true, 7 | head: [["link", { rel: "icon", href: "/favicon.png" }]], 8 | 9 | themeConfig: { 10 | repo: "gridsome/eslint-plugin-gridsome", 11 | docsRepo: "gridsome/eslint-plugin-gridsome", 12 | docsDir: "docs", 13 | docsBranch: "master", 14 | editLinks: true, 15 | nav: [ 16 | { text: "User Guide", link: "/user-guide/" }, 17 | { text: "Developer Guide", link: "/developer-guide/" }, 18 | { text: "Rules", link: "/rules/" }, 19 | { text: "Gridsome", link: "https://gridsome.org/" }, 20 | ], 21 | sidebar: { 22 | "/rules/": ["/rules/", ...Object.keys(rules)], 23 | "/": ["/introduction/", "/user-guide/", "/developer-guide/", "/rules/"], 24 | }, 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /docs/.vuepress/public/eslint-plugin-gridsome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridsome/eslint-plugin-gridsome/9a33d8aa9e7124888a7cfd8bde62aba1dd1c723c/docs/.vuepress/public/favicon.png -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | heroImage: /eslint-plugin-gridsome.svg 4 | heroText: ESLint plugin Gridsome 5 | tagline: ESLint plugin for Gridsome 6 | actionText: Get Started → 7 | actionLink: /introduction/ 8 | footer: MIT Licensed | Copyright © 2018-present Gridsome 9 | --- 10 | -------------------------------------------------------------------------------- /docs/developer-guide/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Developer Guide 3 | --- 4 | 5 | # Developer Guide 6 | 7 | Are you interested in developing this plugin? 8 | **Great!!** 9 | We are always welcome to your help!! 10 | 11 | Please check [CONTRIBUTING.md](https://github.com/gridsome/eslint-plugin-gridsome/blob/master/CONTRIBUTING.md) 12 | -------------------------------------------------------------------------------- /docs/introduction/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | --- 4 | 5 | # Introduction 6 | 7 | Official ESLint plugin for Gridsome. 8 | This plugin helps you to check the `