Skip to content

Commit 1a63365

Browse files
chore: release v1.4.12
2 parents 48e7021 + a78c4b5 commit 1a63365

File tree

86 files changed

+2472
-1070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2472
-1070
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules/**/*
22
log/**/*
3-
tools/update-readme/_readme/*
3+
tools/update-readme/_readme/*
4+
fixtures
5+
lib/**/*.js

.eslintrc.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
/** @type import('eslint').Linter.BaseConfig */
12
module.exports = {
2-
root: true,
3-
env: {
4-
node: true,
5-
es6: true
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
project: "tsconfig.json",
66
},
7-
extends: ["eslint:recommended", "plugin:node/recommended", "prettier"],
8-
plugins: ["prettier"],
7+
extends: ["plugin:@mysticatea/es2017", "plugin:@mysticatea/+eslint-plugin"],
98
rules: {
10-
"prettier/prettier": "error",
11-
"node/no-unpublished-require": ["warn"]
12-
}
9+
"@mysticatea/prettier": [
10+
"error",
11+
{
12+
tabWidth: 2,
13+
},
14+
],
15+
"func-style": ["error", "expression"],
16+
},
1317
};

.github/workflows/check-update.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

.github/workflows/test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88

99
strategy:
1010
matrix:
11-
# Test with Node.js v10 (LTS), v12 (LTS), and v14 (latest)
12-
node-version: [10.x, 12.x, 14.x]
11+
# Test with Node.js v10 (LTS), v12 (LTS), v13, and v14 (latest)
12+
node-version: [10.x, 12.x, 13.x, 14.x]
1313

1414
steps:
1515
- uses: actions/checkout@v2
@@ -32,4 +32,10 @@ jobs:
3232
run: npm ci
3333

3434
- name: Test
35-
run: npm run test
35+
run: npm run test
36+
37+
- name: Test
38+
run: npm run test
39+
40+
- name: Typecheck
41+
run: npm run typecheck

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ typings/
130130
.tool-versions
131131
/development
132132
!/development/.gitkeep
133+
dist

.hygen.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
module.exports = {
22
templates: `${__dirname}/_hygen`,
3-
helpers: {
4-
REPO_URL: () => "https://github.com/gridsome/eslint-plugin-gridsome"
5-
}
63
};

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.4.12](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.11...v1.4.12) (2020-05-22)
2+
3+
4+
15
## [1.4.11](https://github.com/gridsome/eslint-plugin-gridsome/compare/v1.4.9...v1.4.11) (2020-05-13)
26

37

_hygen/generate/rule/rule.ejs.t

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,39 @@
11
---
2-
to: lib/rules/<%= name %>.js
2+
to: lib/rules/<%= name %>.ts
33
---
44
/**
55
* @author <%= author %>
66
* @copyright <%= new Date().getFullYear() %> <%= author %>. All rights reserved.
77
* See LICENSE file in root directory for full license.
88
*/
9-
"use strict";
9+
10+
import { AST } from "vue-eslint-parser";
11+
import { createRule, defineTemplateBodyVisitor } from "../utils";
1012

11-
// ------------------------------------------------------------------------------
12-
// Requirements
13-
// ------------------------------------------------------------------------------
13+
type Options = {};
1414

15-
// ------------------------------------------------------------------------------
16-
// Settings
17-
// ------------------------------------------------------------------------------
15+
const defaultOptions: [Options] = [{}];
1816

19-
module.exports = {
17+
type MessageIds = "<%= h.changeCase.camel(name) %>";
18+
export = createRule<[Options], MessageIds>({
19+
name: "<%= name %>",
2020
meta: {
21-
type: "",
2221
docs: {
2322
description: "<%= description %>",
2423
category: "",
2524
recommended: false,
26-
url: "<%= h.REPO_URL() %>/blob/master/docs/rules/<%= name %>.md",
2725
},
28-
fixable: "",
26+
type: "",
27+
messages: {
28+
<%= h.changeCase.camel(name) %>:
29+
"",
30+
},
2931
schema: [],
30-
deprecated: false,
31-
replacedBy: []
3232
},
33-
create(context) {}
34-
};
35-
36-
37-
38-
39-
40-
41-
42-
43-
44-
45-
46-
47-
48-
49-
50-
33+
defaultOptions,
34+
create(context) {
35+
return defineTemplateBodyVisitor(context, {
36+
37+
});
38+
},
39+
});

_hygen/generate/rule/test.ejs.t

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,29 @@
11
---
2-
to: tests/lib/rules/<%= name %>.js
2+
to: tests/lib/rules/<%= name %>.spec.ts
33
---
4-
"use strict";
4+
import { RuleTester } from "../../util";
55

6-
// ------------------------------------------------------------------------------
7-
// Requirements
8-
// ------------------------------------------------------------------------------
9-
var rule = require("../../../lib/rules/<%= name %>");
10-
var RuleTester = require("eslint").RuleTester;
6+
import rule from "../../../lib/rules/<%= name %>";
117

12-
// ------------------------------------------------------------------------------
13-
// Settings
14-
// ------------------------------------------------------------------------------
15-
var tester = new RuleTester({
8+
const tester = new RuleTester({
169
parser: "vue-eslint-parser",
1710
parserOptions: {
18-
ecmaVersion: 2015
19-
}
11+
ecmaVersion: 2017,
12+
},
2013
});
2114

22-
// ------------------------------------------------------------------------------
23-
// Tests
24-
// ------------------------------------------------------------------------------
2515
tester.run("<%= name %>", rule, {
2616
valid: [
27-
{
28-
code: ``
29-
}
17+
``,
3018
],
3119
invalid: [
3220
{
3321
code: ``,
34-
output: ``,
35-
errors: [""]
36-
}
37-
]
22+
errors: [
23+
{
24+
messageId: "<%= h.changeCase.camel(name) %>",
25+
},
26+
],
27+
},
28+
],
3829
});

docs/.vuepress/config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { rules } = require("../../lib");
1+
const { rules } = require("../../dist/lib");
22

33
module.exports = {
44
title: "eslint-plugin-gridsome",
@@ -16,11 +16,11 @@ module.exports = {
1616
{ text: "User Guide", link: "/user-guide/" },
1717
{ text: "Developer Guide", link: "/developer-guide/" },
1818
{ text: "Rules", link: "/rules/" },
19-
{ text: "Gridsome", link: "https://gridsome.org/" }
19+
{ text: "Gridsome", link: "https://gridsome.org/" },
2020
],
2121
sidebar: {
2222
"/rules/": ["/rules/", ...Object.keys(rules)],
23-
"/": ["/introduction/", "/user-guide/", "/developer-guide/", "/rules/"]
24-
}
25-
}
23+
"/": ["/introduction/", "/user-guide/", "/developer-guide/", "/rules/"],
24+
},
25+
},
2626
};

0 commit comments

Comments
 (0)