Skip to content

Commit

Permalink
fix(commitlint): 🐛 repair commitlint configuration failures (#103)
Browse files Browse the repository at this point in the history
* fix(commitlint): 🐛 repair commitlint configuration failures
After webpack, it needs to fix the `require` expression when require dynamic resources.

* build(webpack): 🔨 add warnings-to-errors-webpack-plugin
By changing warnings to errors, webpack can recognize every warning as errors.

close #102
  • Loading branch information
yi-Xu-0100 authored Mar 25, 2021
1 parent 4dacf43 commit b79bb31
Show file tree
Hide file tree
Showing 13 changed files with 478 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"ts-loader": "^8.0.18",
"typescript": "^4.0.0",
"vsce": "^1.74.0",
"warnings-to-errors-webpack-plugin": "^2.0.1",
"webpack": "^5.25.0",
"webpack-cli": "^4.5.0"
},
Expand Down
4 changes: 3 additions & 1 deletion src/lib/commitlint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
* @since 2020-04-28 14:37
* @author vivaxy
*/
import load from '@commitlint/load';
import load from '../modules/@commitlint/load/lib/load';
import rules from '@commitlint/rules';
import { RulesConfig, RuleConfigSeverity } from '@commitlint/types/lib/rules';
import { Commit } from '@commitlint/types/lib/parse';
import { appendLine } from './output';

class Commitlint {
private ruleConfigs: Partial<RulesConfig> = {};
Expand All @@ -17,6 +18,7 @@ class Commitlint {
return rules;
} catch (e) {
// catch if `Cannot find module "@commitlint/config-conventional"` happens.
appendLine(`[warning]: ${e.message}`);
return {};
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/modules/@commitlint/load/lib/load.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { UserConfig, LoadOptions, QualifiedConfig } from '@commitlint/types';
export default function load(
seed?: UserConfig,
options?: LoadOptions,
): Promise<QualifiedConfig>;
//# sourceMappingURL=load.d.ts.map
123 changes: 123 additions & 0 deletions src/modules/@commitlint/load/lib/load.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/modules/@commitlint/load/lib/utils/load-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { PluginRecords } from '@commitlint/types';
export default function loadPlugin(
plugins: PluginRecords,
pluginName: string,
debug?: boolean,
): PluginRecords;
//# sourceMappingURL=load-plugin.d.ts.map
73 changes: 73 additions & 0 deletions src/modules/@commitlint/load/lib/utils/load-plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 134 additions & 0 deletions src/modules/@commitlint/resolve-extends/lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b79bb31

Please sign in to comment.