Skip to content

Commit

Permalink
♻️ refactor: Update config files to import from dist directory
Browse files Browse the repository at this point in the history
The configuration files for ESlint, Stylelint, Commitlint, Changelog, and Remark are updated to import from the dist directory. The changes are made to `.eslintrc.js`, `.stylelintrc.js`, `.commitlintrc.js`, `.changelogrc.js`, and `.remarkrc.js` files.
  • Loading branch information
canisminor1990 committed Jun 10, 2023
1 parent 2c3c741 commit dac1221
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .changelogrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/changelog');
module.exports = require('./dist').changelog;
2 changes: 1 addition & 1 deletion .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/commitlint');
module.exports = require('./dist').commitlint;
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/eslint');
module.exports = require('./dist').eslint;
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/prettier');
module.exports = require('./dist').prettier;
2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/semantic-release');
module.exports = require('./dist').prettier;
2 changes: 1 addition & 1 deletion .remarkrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/remarklint');
module.exports = require('./dist').remarklint;
2 changes: 1 addition & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/stylelint');
module.exports = require('./dist').stylelint;
42 changes: 14 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,72 +92,58 @@ public-hoist-pattern[]=*stylelint*

### ESlint

config can be found at `./src/eslint/index.ts`
config can be found at [`.eslintrc.js`](/src/eslint/index.ts)

```js
// .eslintrc.js

module.exports = require('@lobehub/lint/dist/eslint');
module.exports = require('@lobehub/lint').eslint;
```

### Stylelint

config can be found at `./src/stylelint/index.ts`
config can be found at [`.stylelintrc.js`](/src/stylelint/index.ts)

```js
// .stylelintrc.js

module.exports = require('@lobehub/lint/dist/stylelint');
module.exports = require('@lobehub/lint').stylelint;
```

### Commitlint

config can be found at `./src/commitlint/index.ts`
config can be found at [`.commitlintrc.js`](/src/commitlint/index.ts)

```js
// .commitlintrc.js

module.exports = require('@lobehub/lint/dist/commitlint');
module.exports = require('@lobehub/lint').commitlint;
```

### Changelog

config can be found at `./src/changelog/index.ts`
config can be found at [`.changelogrc.js`](/src/changelog/index.ts)

```js
// .changelogrc.js

module.exports = require('@lobehub/lint/dist/changelog');
module.exports = require('@lobehub/lint').changelog;
```

### Remark

config can be found at `./src/remarklint/index.ts`
config can be found at [`.remarkrc.js`](/src/remarklint/index.ts)

```js
// .remarkrc.js

module.exports = require('@lobehub/lint/dist/remarklint');
module.exports = require('@lobehub/lint').remarklint;
```

### Prettier

config can be found at `./src/prettier/index.ts`
config can be found at [`.prettierrc.js`](/src/prettier/index.ts)

```js
// .prettierrc.js

module.exports = require('@lobehub/lint/dist/prettier');
module.exports = require('@lobehub/lint').prettier;
```

### Semantic Release

config can be found at `./src/semantic-release/index.ts`
config can be found at [`.releaserc.js`](/src/semantic-release/index.ts)

```js
// .releaserc.js

module.exports = require('@lobehub/lint/dist/semantic-release');
module.exports = require('@lobehub/lint').semanticRelease;
```

<div align="right">
Expand Down
2 changes: 1 addition & 1 deletion src/changelog/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
newlineTimestamp: true,
reduceHeadingLevel: true,
addBackToTop: true,
Expand Down
2 changes: 1 addition & 1 deletion src/commitlint/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['gitmoji'],
rules: {
'footer-leading-blank': [0, 'never'],
Expand Down
2 changes: 1 addition & 1 deletion src/eslint/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: [require.resolve('@umijs/lint/dist/config/eslint')],
plugins: ['simple-import-sort', 'import', 'typescript-sort-keys', 'unused-imports'],
rules: {
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export { default as changelog } from './changelog';
export { default as commitlint } from './commitlint';
export { default as eslint } from './eslint';
export { default as prettier } from './prettier';
export { default as remarklint } from './remarklint';
export { default as semanticRelease } from './semantic-release';
export { default as stylelint } from './stylelint';
2 changes: 1 addition & 1 deletion src/prettier/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: [
require.resolve('prettier-plugin-organize-imports'),
require.resolve('prettier-plugin-packagejson'),
Expand Down
2 changes: 1 addition & 1 deletion src/remarklint/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: [
'remark-gfm',
'remark-frontmatter',
Expand Down
2 changes: 1 addition & 1 deletion src/semantic-release/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
extends: ['semantic-release-config-gitmoji'],
};
2 changes: 1 addition & 1 deletion src/stylelint/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: [
'stylelint-config-recommended',
require.resolve('@umijs/lint/dist/config/stylelint'),
Expand Down

0 comments on commit dac1221

Please sign in to comment.