forked from ota-meshi/stylelint-config-html
-
Notifications
You must be signed in to change notification settings - Fork 0
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
26 changed files
with
520 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,5 @@ | ||
/.nyc_output | ||
/coverage | ||
node_modules | ||
!/.vscode | ||
!/.github |
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,15 @@ | ||
"use strict" | ||
|
||
module.exports = { | ||
parserOptions: { | ||
sourceType: "script", | ||
ecmaVersion: 2020, | ||
}, | ||
extends: [ | ||
"plugin:@ota-meshi/recommended", | ||
"plugin:@ota-meshi/+node", | ||
"plugin:@ota-meshi/+json", | ||
"plugin:@ota-meshi/+yaml", | ||
"plugin:@ota-meshi/+prettier", | ||
], | ||
} |
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,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: ota-meshi | ||
# patreon: # Replace with a single Patreon username | ||
# open_collective: # Replace with a single Open Collective username | ||
# ko_fi: # Replace with a single Ko-fi username | ||
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
# liberapay: # Replace with a single Liberapay username | ||
# issuehunt: # Replace with a single IssueHunt username | ||
# otechie: # Replace with a single Otechie username | ||
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
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,35 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
- name: Install Packages | ||
run: npm i --legacy-peer-deps | ||
- name: Lint | ||
run: npm run lint | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x, 16.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Packages | ||
run: npm i --legacy-peer-deps | ||
- name: Test | ||
run: npm test |
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@v2 | ||
with: | ||
registry-url: "https://registry.npmjs.org" | ||
- name: Install Packages | ||
run: npm i --legacy-peer-deps | ||
- 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 |
---|---|---|
@@ -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,9 @@ | ||
{ | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"json", | ||
"jsonc", | ||
"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 |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# stylelint-config-html | ||
The shareable HTML config for Stylelint. | ||
|
||
[](https://www.npmjs.com/package/stylelint-config-html) | ||
[](https://www.npmjs.com/package/stylelint-config-html) | ||
[](http://www.npmtrends.com/stylelint-config-html) | ||
[](http://www.npmtrends.com/stylelint-config-html) | ||
[](https://github.com/ota-meshi/stylelint-config-html/actions?query=workflow%3ACI) | ||
|
||
> The shareable HTML (and HTML-like) config for Stylelint. | ||
This config bundles the [`postcss-html` custom syntax](https://github.com/ota-meshi/postcss-html) and configures it. | ||
|
||
To see this config, please read the [config itself](/index.js). | ||
|
||
## :cd: Installation | ||
|
||
```shell | ||
npm install --save-dev stylelint-config-html | ||
``` | ||
|
||
## :book: Usage | ||
|
||
Set your `stylelint` config to: | ||
|
||
```json | ||
{ | ||
"extends": "stylelint-config-html" | ||
} | ||
``` | ||
|
||
Note: This config enables HTML (and HTML-like) syntax parsing. | ||
|
||
If you want to enable parsing for only specific language, use each language config as follows: | ||
|
||
```json | ||
{ | ||
"extends": [ | ||
"stylelint-config-html/html", | ||
"stylelint-config-html/xml", | ||
"stylelint-config-html/vue", | ||
"stylelint-config-html/svelte", | ||
"stylelint-config-html/php" | ||
] | ||
} | ||
``` | ||
|
||
## :lock: License | ||
|
||
See the [LICENSE](LICENSE) file for license rights and limitations (MIT). |
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,27 @@ | ||
"use strict" | ||
|
||
const extensions = [ | ||
// https://github.com/Microsoft/vscode/blob/master/extensions/html/package.json | ||
".html", | ||
".htm", | ||
".shtml", | ||
".xhtml", | ||
".xht", | ||
".mdoc", | ||
".jsp", | ||
".asp", | ||
".aspx", | ||
".jshtm", | ||
".volt", | ||
".ejs", | ||
".rhtml", | ||
] | ||
|
||
module.exports = { | ||
overrides: [ | ||
{ | ||
files: extensions.flatMap((ext) => [`*${ext}`, `**/*${ext}`]), | ||
customSyntax: "postcss-html", | ||
}, | ||
], | ||
} |
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,11 @@ | ||
"use strict" | ||
|
||
module.exports = { | ||
extends: [ | ||
require.resolve("./html.js"), | ||
require.resolve("./vue.js"), | ||
require.resolve("./php.js"), | ||
require.resolve("./svelte.js"), | ||
require.resolve("./xml.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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "stylelint-config-html", | ||
"version": "0.0.0", | ||
"description": "The shareable HTML config for Stylelint.", | ||
"keywords": [ | ||
"stylelint", | ||
"stylelint-config", | ||
"html", | ||
"vue", | ||
"svelte", | ||
"php", | ||
"xml" | ||
], | ||
"main": "index.js", | ||
"files": [ | ||
"index.js", | ||
"html.js", | ||
"vue.js", | ||
"svelte.js", | ||
"php.js", | ||
"xml.js" | ||
], | ||
"engines": { | ||
"node": "^12 || >=14" | ||
}, | ||
"scripts": { | ||
"test": "mocha \"tests/lib/**/*.js\" --reporter dot --timeout 60000", | ||
"lint": "eslint .", | ||
"eslint-fix": "eslint . --fix", | ||
"preversion": "npm test && git add ." | ||
}, | ||
"dependencies": { | ||
"postcss-html": "^1.0.0-0" | ||
}, | ||
"peerDependencies": { | ||
"stylelint": ">=14.0.0" | ||
}, | ||
"devDependencies": { | ||
"@ota-meshi/eslint-plugin": "^0.10.0", | ||
"eslint": "^8.0.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-json-schema-validator": "^1.2.24", | ||
"eslint-plugin-jsonc": "^1.7.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-regexp": "~1.4.0", | ||
"eslint-plugin-vue": "^7.18.0", | ||
"eslint-plugin-yml": "^0.10.1", | ||
"mocha": "^9.1.3", | ||
"prettier": "^2.4.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ota-meshi/stylelint-config-html.git" | ||
}, | ||
"author": "Yosuke Ota (https://github.com/ota-meshi)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ota-meshi/stylelint-config-html/issues" | ||
}, | ||
"homepage": "https://github.com/ota-meshi/stylelint-config-html#readme" | ||
} |
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,19 @@ | ||
"use strict" | ||
|
||
const extensions = [ | ||
// https://github.com/Microsoft/vscode/blob/main/extensions/php/package.json | ||
".php", | ||
".php4", | ||
".php5", | ||
".phtml", | ||
".ctp", | ||
] | ||
|
||
module.exports = { | ||
overrides: [ | ||
{ | ||
files: extensions.flatMap((ext) => [`*${ext}`, `**/*${ext}`]), | ||
customSyntax: "postcss-html", | ||
}, | ||
], | ||
} |
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,17 @@ | ||
{ | ||
"extends": [ | ||
"config:base", | ||
":preserveSemverRanges", | ||
":disableDependencyDashboard" | ||
], | ||
"packageRules": [ | ||
{ | ||
"updateTypes": ["minor", "patch", "pin", "digest"], | ||
"automerge": true | ||
}, | ||
{ | ||
"depTypeList": ["devDependencies"], | ||
"automerge": 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict" | ||
|
||
const extensions = [ | ||
// https://github.com/sveltejs/language-tools/blob/master/packages/svelte-vscode/package.json | ||
".svelte", | ||
] | ||
module.exports = { | ||
overrides: [ | ||
{ | ||
files: extensions.flatMap((ext) => [`*${ext}`, `**/*${ext}`]), | ||
customSyntax: "postcss-html", | ||
}, | ||
], | ||
} |
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 @@ | ||
{ | ||
"name": "stylelint-config-html-test-stylelint", | ||
"private": true, | ||
"version": "1.0.0", | ||
"description": "", | ||
"devDependencies": { | ||
"stylelint": "github:stylelint/stylelint#v14", | ||
"stylelint-config-html": "file:../../../../", | ||
"stylelint-config-recommended": "github:stylelint/stylelint-config-recommended#5a51a9d0c5695f39810ef5337118e69cfd8f3139" | ||
}, | ||
"engines": { | ||
"node": "^12 || >=14" | ||
} | ||
} |
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,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
h1 { | ||
color: red; | ||
} | ||
p { | ||
color: #00; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Test</h1> | ||
</body> | ||
</html> |
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 @@ | ||
<style> | ||
a { | ||
color: #00; | ||
} | ||
</style> |
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,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
h1 { | ||
color: red; | ||
} | ||
p { | ||
color: blue; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Test</h1> | ||
</body> | ||
</html> |
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 @@ | ||
<style> | ||
a { | ||
color: red; | ||
} | ||
</style> |
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 @@ | ||
<style> | ||
a { | ||
color: red; | ||
} | ||
</style> |
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 @@ | ||
<style> | ||
a { | ||
color: red; | ||
} | ||
</style> |
Oops, something went wrong.