-
Notifications
You must be signed in to change notification settings - Fork 22
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
1 parent
982b722
commit 7ac673f
Showing
7 changed files
with
437 additions
and
432 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
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,6 +1,6 @@ | ||
module.exports = { | ||
extends: '@zazen/eslint-config', | ||
rules: { | ||
'unicorn/prefer-module': 'off', | ||
}, | ||
extends: '@zazen/eslint-config', | ||
rules: { | ||
'unicorn/prefer-module': '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
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,27 +1,27 @@ | ||
export const incorrectOrder = ` | ||
div { | ||
background-color: slategray; | ||
box-sizing: border-box; | ||
flex: 1 1 auto; | ||
font-size: 1.5rem; | ||
grid-gap: 16px; | ||
order: 1; | ||
pointer-events: all; | ||
position: relative; | ||
transition: opacity 300ms ease; | ||
width: 320px; | ||
}` | ||
div { | ||
background-color: slategray; | ||
box-sizing: border-box; | ||
flex: 1 1 auto; | ||
font-size: 1.5rem; | ||
grid-gap: 16px; | ||
order: 1; | ||
pointer-events: all; | ||
position: relative; | ||
transition: opacity 300ms ease; | ||
width: 320px; | ||
}` | ||
|
||
export const correctOrder = ` | ||
div { | ||
position: relative; | ||
box-sizing: border-box; | ||
flex: 1 1 auto; | ||
grid-gap: 16px; | ||
order: 1; | ||
width: 320px; | ||
font-size: 1.5rem; | ||
pointer-events: all; | ||
background-color: slategray; | ||
transition: opacity 300ms ease; | ||
}` | ||
div { | ||
position: relative; | ||
box-sizing: border-box; | ||
flex: 1 1 auto; | ||
grid-gap: 16px; | ||
order: 1; | ||
width: 320px; | ||
font-size: 1.5rem; | ||
pointer-events: all; | ||
background-color: slategray; | ||
transition: opacity 300ms ease; | ||
}` |
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,32 +1,33 @@ | ||
import test from 'ava' | ||
import stylelint from 'stylelint' | ||
|
||
import { correctOrder, incorrectOrder } from './_fixtures.js' | ||
import config from '../index.js' | ||
|
||
import { correctOrder, incorrectOrder } from './_fixtures.js' | ||
|
||
const runStylelint = async (code) => { | ||
let data = await stylelint.lint({ | ||
code, | ||
config, | ||
}) | ||
let data = await stylelint.lint({ | ||
code, | ||
config, | ||
}) | ||
|
||
return data.results[0] | ||
return data.results[0] | ||
} | ||
|
||
test('with incorrect property order', async (t) => { | ||
let output = await runStylelint(incorrectOrder) | ||
|
||
t.truthy(output.errored, 'indicates linting errors') | ||
t.is( | ||
output.warnings[0].text.trim(), | ||
'Expected "box-sizing" to come before "background-color" (order/properties-order)', | ||
'indicates a properties-order error', | ||
) | ||
let output = await runStylelint(incorrectOrder) | ||
|
||
t.truthy(output.errored, 'indicates linting errors') | ||
t.is( | ||
output.warnings[0].text.trim(), | ||
'Expected "box-sizing" to come before "background-color" (order/properties-order)', | ||
'indicates a properties-order error', | ||
) | ||
}) | ||
|
||
test('with correct property order', async (t) => { | ||
let output = await runStylelint(correctOrder) | ||
let output = await runStylelint(correctOrder) | ||
|
||
t.falsy(output.errored, 'indicates no errors') | ||
t.is(output.warnings.length, 0) | ||
t.falsy(output.errored, 'indicates no errors') | ||
t.is(output.warnings.length, 0) | ||
}) |
Oops, something went wrong.