Skip to content
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

style(actions): prettier & eslint #14

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 9 additions & 9 deletions .czrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const glob = require("glob");
const glob = require('glob');

const globMap = (pattern, fn) =>
glob
.sync(pattern)
.map(fn || (path => path))
.map(path => path.replace(/\/$/, ""));
glob
.sync(pattern)
.map(fn || (path => path))
.map(path => path.replace(/\/$/, ''));

const exclude = variants => path => variants.every(variant => !path.includes(variant));

module.exports = {
// prettier-ignore
types: [
// prettier-ignore
types: [
{ value: 'feat', name: 'feat: A new feature' },
{ value: 'fix', name: 'fix: A bug fix' },
{ value: 'docs', name: 'docs: Documentation only changes' },
Expand All @@ -28,6 +28,6 @@ module.exports = {
' (example scopes: gulp, broccoli, npm)',
}
],
allowCustomScopes: true,
allowBreakingChanges: ["feat", "fix", "revert"],
allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix', 'revert'],
};
66 changes: 41 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
module.exports = {
parser: 'babel-eslint',
plugins: [
// prttier-ignore
'import',
'simple-import-sort',
'prettier',
],
extends: [
// prettier-ignore
'prettier',
'plugin:import/errors',
'plugin:import/warnings',
'airbnb-base',
],
env: { es6: true, node: true },
parser: 'babel-eslint',

parserOptions: {
// ecmaVersion: 2018,
// sourceType: 'module',
},
plugins: [
// prettier-ignore
'import',
'simple-import-sort',
'prettier',
],

rules: {
'prettier/prettier': 'error',
"curly": ["error", "all"], // prettier-ignore
'import/order': 'off',
'simple-import-sort/sort': 'error',
},
extends: [
// prettier-ignore
'plugin:prettier/recommended',
// 'plugin:import/errors',
// 'plugin:import/warnings',
'airbnb-base',
],

env: { es6: true, node: true },

parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},

globals: {
__DEV__: true,
__dirname: true,
fetch: true,
},

rules: {
'indent': ['error', 4], // prettier-ignore
'max-len': ['error', 120],
'prettier/prettier': 'error',
'curly': ['error', 'all'], // prettier-ignore
'import/order': 'off',
'simple-import-sort/sort': 'error',

'class-methods-use-this': 'off',
'no-param-reassign': 'off',
'arrow-parens': 'off',
'import/prefer-default-export': 'off',
},
};
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
npm-debug.log
.editorconfig
dist
.env
build
build*/
package-lock.json
10 changes: 5 additions & 5 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
hooks: {
"pre-commit": "yarn pre-commit",
"pre-push": "yarn pre-push",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
},
hooks: {
'pre-commit': 'yarn pre-commit',
'pre-push': 'yarn pre-push',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
},
};
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
'*.js': ['eslint --quiet --fix', 'prettier --write --plugin-search-dir=.', 'git add'],
'*.js': ['eslint --quiet --fix', 'prettier --write --plugin-search-dir=.', 'git add'],
};
14 changes: 12 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
module.exports = {
trailingComma: "all",
tabWidth: 2,
trailingComma: 'all',
tabWidth: 4,
printWidth: 120,
singleQuote: true,

overrides: [
{
files: '*.json',
options: {
tabWidth: 2,
},
},
],
};
40 changes: 20 additions & 20 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module.exports = {
scripts: {},
scripts: {},

git: {
commitMessage: "chore(release): v${version} :tada:",
tagName: "v${version}",
tagAnnotation: "v${version}",
commitArgs: "-S",
requireCleanWorkingDir: false,
},
git: {
commitMessage: 'chore(release): v${version} :tada:',
tagName: 'v${version}',
tagAnnotation: 'v${version}',
commitArgs: '-S',
requireCleanWorkingDir: false,
},

github: {
release: true,
releaseName: "v${version}",
},
github: {
release: true,
releaseName: 'v${version}',
},

npm: {
publish: false,
},
npm: {
publish: false,
},

plugins: {
"@release-it/conventional-changelog": {
preset: "angular",
infile: "CHANGELOG.md",
plugins: {
'@release-it/conventional-changelog': {
preset: 'angular',
infile: 'CHANGELOG.md',
},
},
},
};
Loading