-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use standard stylelint tooling (#59)
* Use standard stylelint tooling * Ignore ESLint cache * Add remark-preset-prettier
- Loading branch information
Showing
12 changed files
with
12,293 additions
and
119 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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- "dependabot/**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
pretest: | ||
name: Lint on Node.js ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node: [12] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install latest npm | ||
run: npm install --global npm@latest | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
test: | ||
name: Test on Node.js ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [10, 12] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install latest npm | ||
run: npm install --global npm@latest | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
node_modules | ||
package-lock.json | ||
.eslintcache |
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 @@ | ||
package-lock=false | ||
tag-version-prefix = "" |
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
# 3.0.0 | ||
|
||
- Added: `function-calc-no-invalid` rule. | ||
- Removed: `stylelint` < 10.1.0 from peer dependencies. `[email protected]+` is required now. | ||
- Added: `function-calc-no-invalid` rule. | ||
- Removed: `stylelint` < 10.1.0 from peer dependencies. `[email protected]+` is required now. | ||
|
||
# 2.2.0 | ||
|
||
- Added: `stylelint@10` to peer dependency range. | ||
- Added: `stylelint@10` to peer dependency range. | ||
|
||
# 2.1.0 | ||
|
||
- Added: `stylelint@9` to peer dependency range. | ||
- Added: `stylelint@9` to peer dependency range. | ||
|
||
# 2.0.1 | ||
|
||
- Removed: `declaration-block-no-redundant-longhand-properties` rule. This time it is actually removed. | ||
- Removed: `declaration-block-no-redundant-longhand-properties` rule. This time it is actually removed. | ||
|
||
# 2.0.0 | ||
|
||
- Removed: `declaration-block-no-redundant-longhand-properties` rule. | ||
- Removed: `shorthand-property-no-redundant-values` rule. | ||
- Added: `font-family-no-missing-generic-family-keyword` rule. | ||
- Added: `no-descending-specificity` rule. | ||
- Added: `no-duplicate-at-import-rules` rule. | ||
- Added: `no-duplicate-selectors` rule. | ||
- Removed: `declaration-block-no-redundant-longhand-properties` rule. | ||
- Removed: `shorthand-property-no-redundant-values` rule. | ||
- Added: `font-family-no-missing-generic-family-keyword` rule. | ||
- Added: `no-descending-specificity` rule. | ||
- Added: `no-duplicate-at-import-rules` rule. | ||
- Added: `no-duplicate-selectors` rule. | ||
|
||
# 1.0.0 | ||
|
||
- Use `stylelint@8`. | ||
- Use `stylelint@8`. | ||
|
||
# 0.1.0 | ||
|
||
- Initial release | ||
- Initial release |
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 |
---|---|---|
@@ -1,84 +1,82 @@ | ||
"use strict" | ||
"use strict"; | ||
|
||
const config = require("../") | ||
const fs = require("fs") | ||
const stylelint = require("stylelint") | ||
const config = require("../"); | ||
const fs = require("fs"); | ||
const stylelint = require("stylelint"); | ||
|
||
const validCss = fs.readFileSync("./__tests__/css-valid.css", "utf-8") | ||
const invalidCss = fs.readFileSync("./__tests__/css-invalid.css", "utf-8") | ||
const validCss = fs.readFileSync("./__tests__/css-valid.css", "utf-8"); | ||
const invalidCss = fs.readFileSync("./__tests__/css-invalid.css", "utf-8"); | ||
|
||
describe("flags no warnings with valid css", () => { | ||
let result | ||
let result; | ||
|
||
beforeEach(() => { | ||
result = stylelint.lint({ | ||
code: validCss, | ||
config, | ||
}) | ||
}) | ||
}); | ||
}); | ||
|
||
it("did not error", () => { | ||
return result.then(data => ( | ||
expect(data.errored).toBeFalsy() | ||
)) | ||
}) | ||
return result.then((data) => expect(data.errored).toBeFalsy()); | ||
}); | ||
|
||
it("flags no warnings", () => { | ||
return result.then(data => ( | ||
return result.then((data) => | ||
expect(data.results[0].warnings).toHaveLength(0) | ||
)) | ||
}) | ||
}) | ||
); | ||
}); | ||
}); | ||
|
||
describe("flags warnings with invalid css", () => { | ||
let result | ||
let result; | ||
|
||
beforeEach(() => { | ||
result = stylelint.lint({ | ||
code: invalidCss, | ||
config, | ||
}) | ||
}) | ||
}); | ||
}); | ||
|
||
it("did error", () => { | ||
return result.then(data => ( | ||
expect(data.errored).toBeTruthy() | ||
)) | ||
}) | ||
return result.then((data) => expect(data.errored).toBeTruthy()); | ||
}); | ||
|
||
it("flags one warning", () => { | ||
return result.then(data => ( | ||
return result.then((data) => | ||
expect(data.results[0].warnings).toHaveLength(1) | ||
)) | ||
}) | ||
); | ||
}); | ||
|
||
it("correct warning text", () => { | ||
return result.then(data => ( | ||
expect(data.results[0].warnings[0].text).toBe("Unexpected unknown type selector \"madeup\" (selector-type-no-unknown)") | ||
)) | ||
}) | ||
return result.then((data) => | ||
expect(data.results[0].warnings[0].text).toBe( | ||
'Unexpected unknown type selector "madeup" (selector-type-no-unknown)' | ||
) | ||
); | ||
}); | ||
|
||
it("correct rule flagged", () => { | ||
return result.then(data => ( | ||
return result.then((data) => | ||
expect(data.results[0].warnings[0].rule).toBe("selector-type-no-unknown") | ||
)) | ||
}) | ||
); | ||
}); | ||
|
||
it("correct severity flagged", () => { | ||
return result.then(data => ( | ||
return result.then((data) => | ||
expect(data.results[0].warnings[0].severity).toBe("error") | ||
)) | ||
}) | ||
); | ||
}); | ||
|
||
it("correct line number", () => { | ||
return result.then(data => ( | ||
return result.then((data) => | ||
expect(data.results[0].warnings[0].line).toBe(1) | ||
)) | ||
}) | ||
); | ||
}); | ||
|
||
it("correct column number", () => { | ||
return result.then(data => ( | ||
return result.then((data) => | ||
expect(data.results[0].warnings[0].column).toBe(1) | ||
)) | ||
}) | ||
}) | ||
); | ||
}); | ||
}); |
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
Oops, something went wrong.