Skip to content

Commit

Permalink
Add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
cavis committed May 2, 2024
1 parent 4be5c51 commit 4521b2b
Show file tree
Hide file tree
Showing 8 changed files with 1,776 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[Dockerfile]
indent_size = 4
11 changes: 11 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: [airbnb-base, plugin:prettier/recommended]
env:
es2023: true
node: true
parserOptions:
ecmaVersion: latest
sourceType: module
rules:
no-console: off
import/prefer-default-export: off
import/extensions: [error, always]
9 changes: 9 additions & 0 deletions .github/workflows/check-project-std.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Check project standards

on:
push:
workflow_call:

jobs:
check-javascript:
uses: prx/.github/.github/workflows/check-project-std-javascript.yml@main
5 changes: 5 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
overrides:
- files: "*.yml"
options:
singleQuote: false
printWidth: 250
3 changes: 3 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const handler = async (event, context) => {
console.log("hello world", event, context);
};
19 changes: 18 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
},
"private": "true",
"scripts": {
"lint": "npm run lint-prettier && npm run lint-es && npm run lint-ts",
"lint-prettier": "npx prettier --check **/*.{json,yml}",
"lint-es": "npx eslint '**/*.{js,mjs}'",
"lint-ts": "npx tsc",
"lint-fix": "npm run lint-fix-prettier && npm run lint-fix-es",
"lint-fix-prettier": "npx prettier --check **/*.{json,yml} --write",
"lint-fix-es": "npx eslint --fix '**/*.{js,mjs}'",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -25,5 +32,15 @@
"bugs": {
"url": "https://github.com/PRX/dovetail-cdn-usage/issues"
},
"homepage": "https://github.com/PRX/dovetail-cdn-usage#readme"
"homepage": "https://github.com/PRX/dovetail-cdn-usage#readme",
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "*",
"eslint-config-prettier": "*",
"eslint-plugin-import": "*",
"eslint-plugin-jest": "*",
"eslint-plugin-prettier": "*",
"prettier": "^3.2.5",
"typescript": "^5.4.5"
}
}
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2022",
"allowJs": true,
"checkJs": true,
"noEmit": true
}
}
Loading

0 comments on commit 4521b2b

Please sign in to comment.