Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #37 from guardian/add-eslint-config
Browse files Browse the repository at this point in the history
Add eslint config
  • Loading branch information
sndrs authored Dec 4, 2020
2 parents 7c57081 + 5ca8b92 commit 007f250
Show file tree
Hide file tree
Showing 15 changed files with 1,812 additions and 338 deletions.
20 changes: 16 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
; This file is for unifying the coding style for different editors and IDEs
; See editorconfig.org
# based on https://github.com/guardian/configs/blob/main/.editorconfig

; top-most EditorConfig file
root = true

[*]
indent_style = space
# For [accessibility reasons](https://alexandersandberg.com/tabs-for-accessibility/)
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
indent_size = 2
# `npm` autoformats `package.json` every time you install a new dependency.
indent_size = 2

# Because `yml`
[*.yml]
indent_style = space
indent_size = 2

[*.md]
# Using tabs to indent pre-formatted code in markdown makes the spacing too extreme
# when rendered on GitHub, so we revert back to spaces here.
indent_style = space
indent_size = 4
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"root": true,
"env": {
"jest": true,
"browser": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"extends": ["@guardian/eslint-config-typescript"],
"ignorePatterns": ["/dist"]
}
26 changes: 26 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on: push

jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

# based on https://github.com/actions/setup-node/issues/32#issuecomment-539794249
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v2.1.2
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Lint files
run: npm run lint
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.15.0
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@guardian/prettier"
Loading

0 comments on commit 007f250

Please sign in to comment.