Skip to content

Commit

Permalink
Merge pull request #5 from kantord/set-up-lint
Browse files Browse the repository at this point in the history
Set up lint
  • Loading branch information
kantord authored Feb 20, 2022
2 parents 2d28a46 + 2c14809 commit dd63abc
Show file tree
Hide file tree
Showing 10 changed files with 302 additions and 29,493 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
ignorePatterns: ['public'],
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', 'prettier'],
rules: {
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'react/prop-types': 'off',
'prettier/prettier': ['error', { singleQuote: true, semi: false }],
},
}
23 changes: 19 additions & 4 deletions .github/workflows/release.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
name: Release to npm
name: Checks and release

on:
push:
branches: [main]
on: [push]

jobs:
eslint:
name: eslint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Node setup
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Dependencies
run: yarn install --frozen-lockfile
- name: eslint
run: yarn lint
release:
needs:
- eslint
name: Release to npm
runs-on: ubuntu-latest

Expand Down
8 changes: 3 additions & 5 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ process.env.__SRC__ = path.resolve(filename)

const opts = Object.assign({}, cli.flags)

let dev

const gatsby = async (...args) => {
await execa('gatsby', ['clean'], {
cwd: __dirname,
Expand All @@ -78,10 +76,10 @@ const gatsby = async (...args) => {
switch (cmd) {
case 'build':
gatsby('build').then(() => {
const public = path.join(__dirname, 'public')
const public_ = path.join(__dirname, 'public')
const dist = path.join(process.cwd(), 'public')
if (public === dist) return
fs.copySync(public, dist)
if (public_ === dist) return
fs.copySync(public_, dist)
})
break
case 'dev':
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
extends: ['@commitlint/config-conventional'],
}
Loading

0 comments on commit dd63abc

Please sign in to comment.