Skip to content

Commit

Permalink
Use shared organisation configs (#4696)
Browse files Browse the repository at this point in the history
* Use shared remark preset

* Update eslint-config-stylelint

* Use shared prettier config

* Format using shared prettier config

* Revert "Format using shared prettier config"

This reverts commit 76c45a1.

* Use latest Prettier shared config

* Reduce broardness of Prettier ignore

* Format code using shared Prettier config
  • Loading branch information
jeddy3 committed Apr 9, 2020
1 parent aa3b56d commit d527edf
Show file tree
Hide file tree
Showing 39 changed files with 897 additions and 920 deletions.
13 changes: 12 additions & 1 deletion .prettierignore
@@ -1,3 +1,14 @@
**/*.css
.coverage
**/fixtures/**/*.css
**/fixtures/**/*.pcss
**/fixtures/**/*.postcss
**/fixtures/**/*.less
**/fixtures/**/*.scss
**/fixtures/**/*.sass
**/fixtures/**/*.sss
**/fixtures/**/*.vue
**/fixtures/**/*.html
**/fixtures/**/*.markdown
lib/utils/parseCalcExpression/parser.js
scripts/**/*.css
system-tests/**/*.css
23 changes: 0 additions & 23 deletions .prettierrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -60,7 +60,7 @@ We use [Prettier](https://prettier.io/) (with [a Husky and lint-staged precommit

Alternatively, you can:

- trigger the pretty-printing all the files using `npm run prettier:fix`
- trigger the pretty-printing all the files using `npm run format`
- use a [Prettier editor integration](https://prettier.io/docs/en/editors.html)

### Open a pull request
Expand Down
3 changes: 0 additions & 3 deletions jest-setup.js
Expand Up @@ -7,7 +7,6 @@ const util = require('util');
jest.mock('./lib/utils/getOsEol', () => () => '\n');

global.testRule = (rule, schema) => {
// eslint-disable-next-line jest/valid-describe
describe(`${schema.ruleName}`, () => {
const stylelintConfig = {
rules: {
Expand Down Expand Up @@ -138,7 +137,6 @@ global.testRule = (rule, schema) => {

function setupTestCases({ name, cases, schema, comparisons }) {
if (cases && cases.length) {
/* eslint-disable jest/valid-describe */
describe(name, () => {
cases.forEach((testCase) => {
const spec = testCase.only ? it.only : testCase.skip ? it.skip : it;
Expand All @@ -150,7 +148,6 @@ function setupTestCases({ name, cases, schema, comparisons }) {
});
});
});
/* eslint-enable jest/valid-describe */
}
}

Expand Down
13 changes: 8 additions & 5 deletions lib/__tests__/fixtures/config-at-rule-empty-line-before.json
@@ -1,7 +1,10 @@
{
"rules": {
"at-rule-empty-line-before": ["always", {
"except": ["blockless-after-blockless", "inside-block"]
}]
}
"rules": {
"at-rule-empty-line-before": [
"always",
{
"except": ["blockless-after-blockless", "inside-block"]
}
]
}
}
6 changes: 3 additions & 3 deletions lib/__tests__/fixtures/config-block-empty-ok.json
@@ -1,5 +1,5 @@
{
"rules": {
"block-no-empty": null
}
"rules": {
"block-no-empty": null
}
}
6 changes: 3 additions & 3 deletions lib/__tests__/fixtures/config-block-no-empty.json
@@ -1,5 +1,5 @@
{
"rules": {
"block-no-empty": true
}
"rules": {
"block-no-empty": true
}
}
4 changes: 2 additions & 2 deletions lib/__tests__/fixtures/config-color-named-custom-message.yaml
@@ -1,4 +1,4 @@
rules:
color-named:
- "never"
- message: "Unacceptable"
- 'never'
- message: 'Unacceptable'
6 changes: 3 additions & 3 deletions lib/__tests__/fixtures/config-color-no-invalid-hex.json
@@ -1,5 +1,5 @@
{
"rules": {
"color-no-invalid-hex": true
}
"rules": {
"color-no-invalid-hex": true
}
}
4 changes: 2 additions & 2 deletions lib/__tests__/fixtures/config-extending-and-ignoring.json
@@ -1,4 +1,4 @@
{
"ignoreFiles": "**/empty-block.css",
"extends": "./config-block-no-empty"
"ignoreFiles": "**/empty-block.css",
"extends": "./config-block-no-empty"
}
@@ -1,3 +1,3 @@
{
"extends": "./config-extending-two"
"extends": "./config-extending-two"
}
2 changes: 1 addition & 1 deletion lib/__tests__/fixtures/config-extending-one.json
@@ -1,3 +1,3 @@
{
"extends": "./config-block-no-empty"
"extends": "./config-block-no-empty"
}
@@ -1,7 +1,3 @@
{
"extends": [
"./config-color-no-invalid-hex",
"./config-block-no-empty",
"./config-block-empty-ok"
]
"extends": ["./config-color-no-invalid-hex", "./config-block-no-empty", "./config-block-empty-ok"]
}
5 changes: 1 addition & 4 deletions lib/__tests__/fixtures/config-extending-two.json
@@ -1,6 +1,3 @@
{
"extends": [
"./config-block-no-empty",
"./config-color-no-invalid-hex"
]
"extends": ["./config-block-no-empty", "./config-color-no-invalid-hex"]
}
5 changes: 1 addition & 4 deletions lib/__tests__/fixtures/config-extending-with-plugin.json
@@ -1,6 +1,3 @@
{
"extends": [
"./config-extending-two",
"./config-relative-plugin"
]
"extends": ["./config-extending-two", "./config-relative-plugin"]
}
6 changes: 3 additions & 3 deletions lib/__tests__/fixtures/config-no-pixels.json
@@ -1,5 +1,5 @@
{
"rules": {
"unit-blacklist": ["px"]
}
"rules": {
"unit-blacklist": ["px"]
}
}
14 changes: 5 additions & 9 deletions lib/__tests__/fixtures/config-plugin-extending-with-plugin.json
@@ -1,11 +1,7 @@
{
"extends": [
"./config-relative-plugin"
],
"plugins": [
"./plugin-warn-about-bar"
],
"rules": {
"plugin/warn-about-bar": "always",
},
"extends": ["./config-relative-plugin"],
"plugins": ["./plugin-warn-about-bar"],
"rules": {
"plugin/warn-about-bar": "always"
}
}
10 changes: 4 additions & 6 deletions lib/__tests__/fixtures/config-relative-plugin-nested.json
@@ -1,8 +1,6 @@
{
"plugins": [
"./plugin-nested-warn-about-foo"
],
"rules": {
"plugin/warn-about-foo": "always"
}
"plugins": ["./plugin-nested-warn-about-foo"],
"rules": {
"plugin/warn-about-foo": "always"
}
}
10 changes: 4 additions & 6 deletions lib/__tests__/fixtures/config-relative-plugin.json
@@ -1,8 +1,6 @@
{
"plugins": [
"./plugin-warn-about-foo"
],
"rules": {
"plugin/warn-about-foo": "always"
}
"plugins": ["./plugin-warn-about-foo"],
"rules": {
"plugin/warn-about-foo": "always"
}
}
6 changes: 3 additions & 3 deletions lib/__tests__/fixtures/config-string-quotes-single.json
@@ -1,5 +1,5 @@
{
"rules": {
"string-quotes": "single"
}
"rules": {
"string-quotes": "single"
}
}
6 changes: 3 additions & 3 deletions lib/__tests__/fixtures/config-with-undefined-rule.json
@@ -1,5 +1,5 @@
{
"rules": {
"unknown-rule": null
}
"rules": {
"unknown-rule": null
}
}
10 changes: 6 additions & 4 deletions lib/__tests__/standalone.test.js
Expand Up @@ -383,10 +383,12 @@ describe('nonexistent codeFilename with loaded config', () => {
});

it('does not cause error', () => {
return standalone({
code: 'a {}',
codeFilename: 'does-not-exist.css',
});
return expect(() =>
standalone({
code: 'a {}',
codeFilename: 'does-not-exist.css',
}),
).not.toThrow();
});

it('does load config from process.cwd', () => {
Expand Down
@@ -1,5 +1,5 @@
{
"rules": {
"block-no-empty": true
}
"rules": {
"block-no-empty": true
}
}
@@ -1,5 +1,5 @@
{
"rules": {
"color-no-invalid-hex": true
}
"rules": {
"color-no-invalid-hex": true
}
}
1 change: 0 additions & 1 deletion lib/rules/function-calc-no-invalid/index.js
Expand Up @@ -162,7 +162,6 @@ function getNumber(mathExpression) {
? getNumber(right)
: null;

// eslint-disable-next-line eqeqeq
if (leftValue == null || rightValue == null) {
return null;
}
Expand Down

0 comments on commit d527edf

Please sign in to comment.