Skip to content

Instantly share code, notes, and snippets.

@alexrqs
Created October 1, 2019 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexrqs/1cd095e29ad71a794385ad136a03b601 to your computer and use it in GitHub Desktop.
Save alexrqs/1cd095e29ad71a794385ad136a03b601 to your computer and use it in GitHub Desktop.
JS project should have (active development)
aliases:
- &restore-yarn-cache
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- &save-yarn-cache
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
version: 2
node_defaults: &node_defaults
docker:
- image: circleci/node:10.16.3-browsers
working_directory: ~/repo
npm_login: &npm_login
run:
name: Login to npm
# replace "userOrCompany USERORCOMPANY" with your actual company ... or user
# this is useful in case your company has a namespace
# and your repo depends on private packages
command: |
npm config set @userOrCompany:registry=http://registry.npmjs.org/
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN_USERORCOMPANY
yarn_install: &yarn_install
run:
name: yarn install
command: yarn install --non-interactive
experimental:
notify:
branches:
only:
- master
- develop
jobs:
build_lint_and_test:
<<: *node_defaults
steps:
- checkout
- *npm_login
- restore-cache: *restore-yarn-cache
- *yarn_install
- save-cache: *save-yarn-cache
- run: yarn build
- run: yarn lint
- run: yarn test
publish_to_npm:
<<: *node_defaults
steps:
- checkout
- *npm_login
- restore-cache: *restore-yarn-cache
- *yarn_install
- save-cache: *save-yarn-cache
- *lerna_bootstrap
- run: yarn build
- run:
name: Set git configurations
command: |
git config --global user.email "circleci@circleci.com"
git config --global user.name "CircleCI"
# publish with conventional commits
# save this step to use conventional commits
# - run conventional commits
- run:
name: Lerna publish
command: node_modules/.bin/lerna publish --yes --conventional-commits
- run:
name: Push release commit
command: git push origin ${CIRCLE_BRANCH}
- store_artifacts:
path: /root/project/packages/
workflows:
version: 2
continuous_integration:
jobs:
- build_lint_and_test
- publish_to_npm:
requires:
- build_lint_and_test
filters:
branches:
only:
- develop
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
module.exports = {
extends: ['airbnb', 'plugin:prettier/recommended'],
parser: 'babel-eslint',
env: {
browser: true,
node: true,
jest: true,
},
globals: {
__DEPLOY_LOWERS__: true,
__DEPLOY_ENV__: true,
__DEV__: true,
__PORT__: true,
},
plugins: ['react', 'jsx-a11y', 'import'],
rules: {
'no-return-assign': ['off'],
'no-console': ['error'],
'class-methods-use-this': ['off'],
'no-param-reassign': ['error', { props: false }],
semi: ['error', 'never'],
'arrow-parens': ['error', 'as-needed'],
'global-require': 'off',
'react/sort-comp': [
'error',
{
order: ['lifecycle', 'everything-else', 'rendering', 'static-methods'],
groups: {
rendering: ['/^render.+$/', 'render'],
},
},
],
'jsx-a11y/href-no-hash': ['off'],
'jsx-a11y/anchor-has-content': ['off'],
'react/jsx-indent-props': ['off'],
'react/jsx-indent': ['off'],
'react/jsx-closing-bracket-location': ['off'],
'react/jsx-wrap-multilines': ['off'],
'object-curly-newline': ['error', { consistent: true }],
'function-paren-newline': ['off'],
'no-use-before-define': ['off'],
// this is not necessary because the project is next.js
'react/react-in-jsx-scope': ['off'],
'react/no-typos': ['off'],
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: false,
},
AssignmentExpression: {
array: true,
object: true,
},
},
],
},
}
{
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged",
"pre-push": "yarn test && yarn lint"
}
}
}
{
"arrowParens": "avoid",
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}

[] readme, steps to clone and to use [] prettier (rc|ignore) [] husky [] test [] standalone (with or without webtools scope) [] recipes [] QA page [] pipeline [] circle-ci (automatic bumps) [] editorconfig [] eslint [] hot-reload [] core-logic [] postcss for all browsers [] match design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment