-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
86 changed files
with
2,472 additions
and
1,070 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules/**/* | ||
log/**/* | ||
tools/update-readme/_readme/* | ||
tools/update-readme/_readme/* | ||
fixtures | ||
lib/**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
/** @type import('eslint').Linter.BaseConfig */ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
es6: true | ||
parserOptions: { | ||
ecmaVersion: 2017, | ||
project: "tsconfig.json", | ||
}, | ||
extends: ["eslint:recommended", "plugin:node/recommended", "prettier"], | ||
plugins: ["prettier"], | ||
extends: ["plugin:@mysticatea/es2017", "plugin:@mysticatea/+eslint-plugin"], | ||
rules: { | ||
"prettier/prettier": "error", | ||
"node/no-unpublished-require": ["warn"] | ||
} | ||
"@mysticatea/prettier": [ | ||
"error", | ||
{ | ||
tabWidth: 2, | ||
}, | ||
], | ||
"func-style": ["error", "expression"], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Check Update | ||
|
||
on: push | ||
|
||
jobs: | ||
checkDocs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v1 | ||
id: cache | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
- name: Use Node.js 12 | ||
uses: actions/setup-node@v1 | ||
with: | ||
registry-url: "https://registry.npmjs.org" | ||
node-version: '12.x' | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Update Rules Docs | ||
run: npm run update | ||
|
||
- name: Check diff | ||
id: check-diff | ||
run: | | ||
echo ::set-output name=diff-files::$(git diff --diff-filter=AM --name-only) | ||
- name: Report | ||
if: steps.check-diff.outputs.diff-files | ||
uses: mshick/add-pr-comment@v1 | ||
with: | ||
message: | | ||
Please run `npm run update` | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
allow-repeats: 'true' | ||
|
||
- name: Exit | ||
if: steps.check-diff.outputs.diff-files | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,4 @@ typings/ | |
.tool-versions | ||
/development | ||
!/development/.gitkeep | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
module.exports = { | ||
templates: `${__dirname}/_hygen`, | ||
helpers: { | ||
REPO_URL: () => "https://github.com/gridsome/eslint-plugin-gridsome" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,39 @@ | ||
--- | ||
to: lib/rules/<%= name %>.js | ||
to: lib/rules/<%= name %>.ts | ||
--- | ||
/** | ||
* @author <%= author %> | ||
* @copyright <%= new Date().getFullYear() %> <%= author %>. All rights reserved. | ||
* See LICENSE file in root directory for full license. | ||
*/ | ||
"use strict"; | ||
|
||
import { AST } from "vue-eslint-parser"; | ||
import { createRule, defineTemplateBodyVisitor } from "../utils"; | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Requirements | ||
// ------------------------------------------------------------------------------ | ||
type Options = {}; | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Settings | ||
// ------------------------------------------------------------------------------ | ||
const defaultOptions: [Options] = [{}]; | ||
|
||
module.exports = { | ||
type MessageIds = "<%= h.changeCase.camel(name) %>"; | ||
export = createRule<[Options], MessageIds>({ | ||
name: "<%= name %>", | ||
meta: { | ||
type: "", | ||
docs: { | ||
description: "<%= description %>", | ||
category: "", | ||
recommended: false, | ||
url: "<%= h.REPO_URL() %>/blob/master/docs/rules/<%= name %>.md", | ||
}, | ||
fixable: "", | ||
type: "", | ||
messages: { | ||
<%= h.changeCase.camel(name) %>: | ||
"", | ||
}, | ||
schema: [], | ||
deprecated: false, | ||
replacedBy: [] | ||
}, | ||
create(context) {} | ||
}; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
defaultOptions, | ||
create(context) { | ||
return defineTemplateBodyVisitor(context, { | ||
|
||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,29 @@ | ||
--- | ||
to: tests/lib/rules/<%= name %>.js | ||
to: tests/lib/rules/<%= name %>.spec.ts | ||
--- | ||
"use strict"; | ||
import { RuleTester } from "../../util"; | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Requirements | ||
// ------------------------------------------------------------------------------ | ||
var rule = require("../../../lib/rules/<%= name %>"); | ||
var RuleTester = require("eslint").RuleTester; | ||
import rule from "../../../lib/rules/<%= name %>"; | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Settings | ||
// ------------------------------------------------------------------------------ | ||
var tester = new RuleTester({ | ||
const tester = new RuleTester({ | ||
parser: "vue-eslint-parser", | ||
parserOptions: { | ||
ecmaVersion: 2015 | ||
} | ||
ecmaVersion: 2017, | ||
}, | ||
}); | ||
|
||
// ------------------------------------------------------------------------------ | ||
// Tests | ||
// ------------------------------------------------------------------------------ | ||
tester.run("<%= name %>", rule, { | ||
valid: [ | ||
{ | ||
code: `` | ||
} | ||
``, | ||
], | ||
invalid: [ | ||
{ | ||
code: ``, | ||
output: ``, | ||
errors: [""] | ||
} | ||
] | ||
errors: [ | ||
{ | ||
messageId: "<%= h.changeCase.camel(name) %>", | ||
}, | ||
], | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import recommended from "./configs/recommended"; | ||
|
||
export const configs = { | ||
recommended, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export = { | ||
parser: "vue-eslint-parser", | ||
parserOptions: { | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
plugins: ["gridsome"], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export = { | ||
extends: require.resolve("./base"), | ||
rules: { | ||
"gridsome/format-query-block": "warn", | ||
"gridsome/require-g-image-src": "error", | ||
"gridsome/require-g-link-to": "warn", | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { rules } from "./rules"; | ||
import { configs } from "./configs"; | ||
|
||
export = { | ||
rules, | ||
configs, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file has been automatically generated, in order to update it's content execute "npm run update" | ||
import formatQueryBlock from "./rules/format-query-block"; | ||
import requireGImageSrc from "./rules/require-g-image-src"; | ||
import requireGLinkTo from "./rules/require-g-link-to"; | ||
|
||
export const rules = { | ||
"format-query-block": formatQueryBlock, | ||
"require-g-image-src": requireGImageSrc, | ||
"require-g-link-to": requireGLinkTo, | ||
}; |
Oops, something went wrong.