-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
847 changed files
with
100,876 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use strict" | ||
|
||
// const version = require("./package.json").version | ||
|
||
module.exports = { | ||
parserOptions: { | ||
sourceType: "script", | ||
ecmaVersion: 2020, | ||
}, | ||
extends: ["plugin:@mysticatea/es2015", "plugin:@mysticatea/+node"], | ||
rules: { | ||
"require-jsdoc": "error", | ||
"no-warning-comments": "warn", | ||
"no-lonely-if": "off", | ||
"@mysticatea/ts/ban-ts-ignore": "off", | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.ts"], | ||
rules: { | ||
"@mysticatea/node/no-missing-import": "off", | ||
"no-implicit-globals": "off", | ||
"@mysticatea/node/no-extraneous-import": "off", | ||
}, | ||
parserOptions: { | ||
sourceType: "module", | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
{ | ||
files: ["scripts/**/*.ts", "tests/**/*.ts"], | ||
rules: { | ||
"require-jsdoc": "off", | ||
"no-console": "off", | ||
}, | ||
}, | ||
], | ||
} |
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: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install Packages | ||
run: npm install | ||
- name: Lint | ||
run: npm run lint | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.13.x, 12.x, 13.x, 14.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Packages | ||
run: npm install | ||
- name: Test | ||
run: npm test | ||
test-and-coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- name: Install Packages | ||
run: npm install | ||
- name: Test | ||
run: npm run cover | ||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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,26 @@ | ||
name: publish | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
jobs: | ||
release: | ||
name: check version, and release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install Packages | ||
run: npm install | ||
- name: test | ||
run: npm run test | ||
- name: check can npm-publish | ||
run: npx can-npm-publish | ||
- name: release | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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 |
---|---|---|
|
@@ -102,3 +102,6 @@ dist | |
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Build | ||
/lib |
Empty file.
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 @@ | ||
package-lock=false |
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,14 @@ | ||
{ | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"vue", | ||
"typescript" | ||
], | ||
"typescript.validate.enable": true, | ||
"javascript.validate.enable": false, | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true, | ||
} | ||
} |
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,2 +1,71 @@ | ||
# yaml-eslint-parser | ||
A YAML parser that produces output compatible with ESLint | ||
|
||
A YAML parser that produces output [compatible with ESLint](https://eslint.org/docs/developer-guide/working-with-custom-parsers#all-nodes). | ||
|
||
This parser is backed by excellent [yaml](https://github.com/eemeli/yaml) and [yaml-unist-parser](https://github.com/ikatyang/yaml-unist-parser) packages. | ||
|
||
[](https://www.npmjs.com/package/yaml-eslint-parser) | ||
[](https://www.npmjs.com/package/yaml-eslint-parser) | ||
[](http://www.npmtrends.com/yaml-eslint-parser) | ||
[](http://www.npmtrends.com/yaml-eslint-parser) | ||
[](http://www.npmtrends.com/yaml-eslint-parser) | ||
[](http://www.npmtrends.com/yaml-eslint-parser) | ||
[](http://www.npmtrends.com/yaml-eslint-parser) | ||
[](https://github.com/ota-meshi/yaml-eslint-parser/actions?query=workflow%3ACI) | ||
[](https://coveralls.io/github/ota-meshi/yaml-eslint-parser?branch=master) | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install --save-dev yaml-eslint-parser | ||
``` | ||
|
||
## Usage | ||
|
||
### Configuration | ||
|
||
Use `.eslintrc.*` file to configure parser. See also: [https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring). | ||
|
||
Example **.eslintrc.js**: | ||
|
||
```js | ||
module.exports = { | ||
"overrides": [ | ||
{ | ||
"files": ["*.yaml", "*.yml"], | ||
"parser": "yaml-eslint-parser" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Running ESLint from the command line | ||
|
||
If you want to run `eslint` from the command line, make sure you include the `.yaml` extension using [the `--ext` option](https://eslint.org/docs/user-guide/configuring#specifying-file-extensions-to-lint) or a glob pattern, because ESLint targets only `.js` files by default. | ||
|
||
Examples: | ||
|
||
```bash | ||
eslint --ext .js,.yaml,.yml src | ||
eslint "src/**/*.{js,yaml,yml}" | ||
``` | ||
|
||
## Editor Integrations | ||
|
||
### Visual Studio Code | ||
|
||
Use the [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension that Microsoft provides officially. | ||
|
||
You have to configure the `eslint.validate` option of the extension to check `.yaml` files, because the extension targets only `*.js` or `*.jsx` files by default. | ||
|
||
Example **.vscode/settings.json**: | ||
|
||
```json | ||
{ | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"yaml" | ||
] | ||
} | ||
``` |
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,52 @@ | ||
{ | ||
"name": "yaml-eslint-parser", | ||
"version": "0.0.0", | ||
"description": "A YAML parser that produces output compatible with ESLint", | ||
"main": "lib/index.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"prebuild": "npm run -s clean", | ||
"build": "tsc --project ./tsconfig.build.json", | ||
"clean": "rimraf .nyc_output lib coverage", | ||
"lint": "eslint \"tests\" \"src\" --ext .js,.ts", | ||
"eslint-fix": "npm run lint -- --fix", | ||
"test": "mocha --require ts-node/register \"tests/src/**/*.ts\" --reporter dot --timeout 60000", | ||
"cover": "nyc --reporter=lcov npm run test", | ||
"debug": "mocha --require ts-node/register --inspect \"tests/src/**/*.ts\" --reporter dot", | ||
"update-fixtures": "ts-node ./tools/update-fixtures.ts" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ota-meshi/yaml-eslint-parser.git" | ||
}, | ||
"keywords": [ | ||
"yaml", | ||
"eslint", | ||
"parser" | ||
], | ||
"author": "Yosuke Ota", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ota-meshi/yaml-eslint-parser/issues" | ||
}, | ||
"homepage": "https://github.com/ota-meshi/yaml-eslint-parser#readme", | ||
"dependencies": { | ||
"eslint-visitor-keys": "^1.3.0", | ||
"yaml": "^1.10.0", | ||
"yaml-unist-parser": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"@mysticatea/eslint-plugin": "^13.0.0", | ||
"@types/eslint": "^7.2.0", | ||
"@types/mocha": "^7.0.2", | ||
"@types/node": "^14.0.13", | ||
"eslint": "^7.5.0", | ||
"mocha": "^7.0.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.0.5", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.9.7" | ||
} | ||
} |
Oops, something went wrong.