-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rework internals and external api
This is a large rework of how the d2-style tool works in order to simplify usage and allow for more flexible usage. Notable changes: - Removes lint-staged and removes automatically staging formatted files. - Only runs checks when commiting by default to ensure consistency. - Includes recommended ESLint rules in the default ESLint config. - Includes a React project. - Renames `setup` to `install` and adds a `--list-groups` option. `install` is preferred to be able to pair it with an `uninstall` command in the future. - Adds command to use Prettier to format structured text files (html, yaml, markdown, etc.). - Uses `npx` internally to execute command binaries instead of relying on the NodeJS API, this makes the entire code base a lot simpler to work with and to add new commands. - `check` and `apply` commands now accept a `--pattern` to match files. - Uses `fast-glob` to grab all files that match a pattern, then filters them against other parameters, e.g. if they are staged or if only a single file is given. BREAKING CHANGE: Removes LintStaged, renames `setup` to `install`, removes `validate` command. Uses a different way to match files and filters out results instead.
- Loading branch information
Showing
51 changed files
with
1,203 additions
and
2,110 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
> 0.5% | ||
last 2 versions | ||
Firefox ESR | ||
ie 11 | ||
not ie 11 | ||
not dead |
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,16 +1,16 @@ | ||
version: 1 | ||
|
||
update_configs: | ||
- package_manager: "javascript" | ||
directory: "/" | ||
update_schedule: "daily" | ||
version_requirement_updates: "increase_versions" | ||
target_branch: "master" | ||
automerged_updates: | ||
- match: | ||
dependency_name: "@dhis2/*" | ||
dependency_type: "all" | ||
update_type: "semver:minor" | ||
- match: | ||
dependency_type: "all" | ||
update_type: "security:patch" | ||
- package_manager: 'javascript' | ||
directory: '/' | ||
update_schedule: 'daily' | ||
version_requirement_updates: 'increase_versions' | ||
target_branch: 'master' | ||
automerged_updates: | ||
- match: | ||
dependency_name: '@dhis2/*' | ||
dependency_type: 'all' | ||
update_type: 'semver:minor' | ||
- match: | ||
dependency_type: 'all' | ||
update_type: 'security:patch' |
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 |
---|---|---|
|
@@ -2,4 +2,8 @@ const { config } = require('./index.js') | |
|
||
module.exports = { | ||
extends: [config.eslint], | ||
|
||
env: { | ||
es6: 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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
const tasks = arr => arr.join(' && ') | ||
|
||
module.exports = { | ||
hooks: { | ||
'commit-msg': './bin/d2-style commit check', | ||
'pre-commit': | ||
'yarn test && ./bin/d2-style validate --lint-staged-config .lint-stagedrc.js', | ||
'pre-commit': tasks([ | ||
'./bin/d2-style js check --staged', | ||
'./bin/d2-style text check --staged', | ||
]), | ||
'pre-push': 'yarn test', | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.