Skip to content

chore: remove xo in favor of stricter prettier setup #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To keep the code base of commitlint neat and tidy the following rules apply to e

> Coding standards

* [Happiness](https://github.com/sindresorhus/xo) enforced
* `prettier` is king
* Favor micro library over swiss army knives (rimraf, ncp vs. fs-extra)
* Be awesome

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

1 change: 0 additions & 1 deletion @alias/commitlint-config-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"deps": "dep-check",
"pkg": "pkg-check"
},
"xo": false,
"repository": {
"type": "git",
"url": "git+https://github.com/marionebl/commitlint.git"
Expand Down
1 change: 0 additions & 1 deletion @alias/commitlint-config-lerna-scopes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"deps": "dep-check",
"pkg": "pkg-check"
},
"xo": false,
"repository": {
"type": "git",
"url": "git+https://github.com/marionebl/commitlint.git"
Expand Down
1 change: 0 additions & 1 deletion @alias/commitlint-config-patternplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"deps": "dep-check",
"pkg": "pkg-check"
},
"xo": false,
"repository": {
"type": "git",
"url": "git+https://github.com/marionebl/commitlint.git"
Expand Down
1 change: 0 additions & 1 deletion @alias/commitlint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"deps": "dep-check",
"pkg": "pkg-check --skip-main"
},
"xo": false,
"engines": {
"node": ">=4"
},
Expand Down
5 changes: 1 addition & 4 deletions @commitlint/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check",
"lint": "xo",
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -33,7 +32,6 @@
"babel-preset-commitlint"
]
},
"xo": false,
"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -71,8 +69,7 @@
"rimraf": "2.6.2",
"sander": "0.6.0",
"string-to-stream": "1.1.0",
"tmp": "0.0.33",
"xo": "0.20.3"
"tmp": "0.0.33"
},
"dependencies": {
"@commitlint/format": "^7.4.0",
Expand Down
8 changes: 5 additions & 3 deletions @commitlint/cli/src/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ module.exports = flags => {
const flags = line[0];
const desc = line[1];
const defaults = line[2];
const fs = flags.map(
flag => (flag.length > 1 ? `--${flag}` : ` -${flag}`)
const fs = flags.map(flag =>
flag.length > 1 ? `--${flag}` : ` -${flag}`
);
const ds = defaults ? `, defaults to: ${defaults}` : '';
const length = flags.reduce((sum, flag) => sum + flag.length, 0);
return `${fs.join(',')}${' '.repeat(Math.max(4 + longest - length, 0))}${desc}${ds}`;
return `${fs.join(',')}${' '.repeat(
Math.max(4 + longest - length, 0)
)}${desc}${ds}`;
})
.join('\n');
};
5 changes: 1 addition & 4 deletions @commitlint/config-angular-type-enum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
"clean": "exit 0",
"deps": "dep-check",
"pkg": "pkg-check",
"lint": "xo",
"start": "exit 0",
"test": "exit 0"
},
"xo": false,
"repository": {
"type": "git",
"url": "git+https://github.com/marionebl/commitlint.git"
Expand All @@ -31,7 +29,6 @@
},
"homepage": "https://github.com/marionebl/commitlint#readme",
"devDependencies": {
"@commitlint/utils": "^7.3.1",
"xo": "0.20.3"
"@commitlint/utils": "^7.3.1"
}
}
2 changes: 0 additions & 2 deletions @commitlint/config-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
"clean": "exit 0",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo",
"start": "exit 0",
"test": "exit 0"
},
"xo": false,
"repository": {
"type": "git",
"url": "git+https://github.com/marionebl/commitlint.git"
Expand Down
2 changes: 0 additions & 2 deletions @commitlint/config-conventional/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
"clean": "exit 0",
"deps": "dep-check",
"pkg": "pkg-check",
"lint": "xo",
"start": "exit 0",
"test": "exit 0"
},
"xo": false,
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 1 addition & 4 deletions @commitlint/config-lerna-scopes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
],
"scripts": {
"clean": "exit 0",
"lint": "xo",
"start": "ava --watch --verbose",
"test": "ava --verbose",
"deps": "dep-check",
"pkg": "pkg-check"
},
"xo": false,
"ava": {
"files": [
"test.js"
Expand Down Expand Up @@ -52,7 +50,6 @@
"@commitlint/utils": "^7.3.1",
"@lerna/project": "3.5.0",
"ava": "0.22.0",
"lerna": "3.1.1",
"xo": "0.20.3"
"lerna": "3.1.1"
}
}
5 changes: 1 addition & 4 deletions @commitlint/config-patternplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
"clean": "exit 0",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo",
"start": "exit 0",
"test": "exit 0"
},
"xo": false,
"repository": {
"type": "git",
"url": "git+https://github.com/marionebl/commitlint.git"
Expand All @@ -36,7 +34,6 @@
"lodash": "4.17.11"
},
"devDependencies": {
"@commitlint/utils": "^7.3.1",
"xo": "0.20.3"
"@commitlint/utils": "^7.3.1"
}
}
7 changes: 1 addition & 6 deletions @commitlint/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
],
"scripts": {
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo"
"pkg": "pkg-check --skip-import"
},
"xo": false,
"engines": {
"node": ">=4"
},
Expand All @@ -33,9 +31,6 @@
"email": "[email protected]"
},
"license": "MIT",
"devDependencies": {
"xo": "0.20.3"
},
"dependencies": {
"@commitlint/format": "^7.4.0",
"@commitlint/lint": "^7.4.0",
Expand Down
5 changes: 1 addition & 4 deletions @commitlint/ensure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo",
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -35,7 +34,6 @@
"babel-preset-commitlint"
]
},
"xo": false,
"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -68,8 +66,7 @@
"concurrently": "3.5.1",
"cross-env": "5.1.1",
"globby": "8.0.1",
"rimraf": "2.6.1",
"xo": "0.20.3"
"rimraf": "2.6.1"
},
"dependencies": {
"lodash": "4.17.11"
Expand Down
9 changes: 6 additions & 3 deletions @commitlint/ensure/src/case.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ function ensureCase(raw = '', target = 'lowercase') {
const input = String(raw)
.replace(/`.*?`|".*?"|'.*?'/g, '')
.trim();

const delimiters = /(\/|\\)/g;
const transformed = input.split(delimiters)
.map(segment => delimiters.test(segment) ? segment : toCase(segment, target))
const transformed = input
.split(delimiters)
.map(segment =>
delimiters.test(segment) ? segment : toCase(segment, target)
)
.join('');

if (transformed === '' || transformed.match(/^\d/)) {
Expand Down
8 changes: 3 additions & 5 deletions @commitlint/execute-rule/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check",
"lint": "xo",

"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -35,7 +35,7 @@
"babel-preset-commitlint"
]
},
"xo": false,

"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -68,9 +68,7 @@
"babel-register": "6.26.0",
"concurrently": "3.5.1",
"cross-env": "5.1.1",
"rimraf": "2.6.1",
"xo": "0.20.3"
},
"rimraf": "2.6.1" },
"dependencies": {
"babel-runtime": "6.26.0"
}
Expand Down
8 changes: 3 additions & 5 deletions @commitlint/format/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo",

"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -35,7 +35,7 @@
"babel-preset-commitlint"
]
},
"xo": false,

"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -68,9 +68,7 @@
"concurrently": "3.5.1",
"cross-env": "5.1.1",
"lodash": "4.17.11",
"rimraf": "2.6.1",
"xo": "0.20.3"
},
"rimraf": "2.6.1" },
"dependencies": {
"babel-runtime": "^6.23.0",
"chalk": "^2.0.1"
Expand Down
8 changes: 3 additions & 5 deletions @commitlint/is-ignored/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check",
"lint": "xo",

"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -35,7 +35,7 @@
"babel-preset-commitlint"
]
},
"xo": false,

"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -68,9 +68,7 @@
"babel-register": "6.26.0",
"concurrently": "3.5.1",
"cross-env": "5.1.1",
"rimraf": "2.6.1",
"xo": "0.20.3"
},
"rimraf": "2.6.1" },
"dependencies": {
"semver": "5.6.0"
}
Expand Down
8 changes: 3 additions & 5 deletions @commitlint/lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo",

"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -35,7 +35,7 @@
"babel-preset-commitlint"
]
},
"xo": false,

"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -69,9 +69,7 @@
"cross-env": "5.1.1",
"execa": "0.9.0",
"globby": "8.0.1",
"rimraf": "2.6.1",
"xo": "0.20.3"
},
"rimraf": "2.6.1" },
"dependencies": {
"@commitlint/is-ignored": "^7.3.1",
"@commitlint/parse": "^7.3.1",
Expand Down
8 changes: 3 additions & 5 deletions @commitlint/load/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "npx rimraf lib",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"lint": "xo",

"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose && ava \"src/*.serial-test.js\" --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
Expand All @@ -35,7 +35,7 @@
"babel-preset-commitlint"
]
},
"xo": false,

"engines": {
"node": ">=4"
},
Expand Down Expand Up @@ -69,9 +69,7 @@
"cross-env": "5.1.1",
"execa": "0.9.0",
"globby": "8.0.1",
"rimraf": "2.6.1",
"xo": "0.20.3"
},
"rimraf": "2.6.1" },
"dependencies": {
"@commitlint/execute-rule": "^7.3.1",
"@commitlint/resolve-extends": "^7.3.1",
Expand Down
Loading