Skip to content

Commit 1744708

Browse files
committed
test(example): test to run *-example.js
1 parent 4205236 commit 1744708

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"eslint": "eslint src/**/*.js",
2525
"eslint:md": "eslint -c .md.eslintrc --ext .md ja/**/*.md",
2626
"textlint": "summary-to-path | xargs textlint --rule spellcheck-tech-word",
27-
"test": "mocha --recursive && npm run textlint && npm run eslint:md && npm run eslint && npm run build"
27+
"test:example": "find ./src -name '*-example.js' | xargs babel-node",
28+
"test": "mocha --recursive && npm run test:example && npm run textlint && npm run eslint:md && npm run eslint && npm run build"
2829
},
2930
"keywords": [
3031
"plugin",

src/ESLint/MyLinter-example.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use strict";
22
import assert from "assert";
33
import MyLinter from "./MyLinter";
4-
import noConsole from "./noConsole";
4+
import noConsole from "./no-console";
5+
56
let linter = new MyLinter();
67
linter.loadPlugin(noConsole);
78
var results = linter.lint(`console.log("test")`);

0 commit comments

Comments
 (0)