From 56fe5b43c5e134f940b8410245ca050fc9a5fa33 Mon Sep 17 00:00:00 2001 From: tech-consortium <23320411+tech-consortium@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:46:38 -0600 Subject: [PATCH] Changes to enforce code quality. --- .editorconfig | 16 ++++++++++++++++ .eslintrc | 5 ----- .eslintrc.js | 27 +++++++++++++++++++++++++++ .husky/pre-commit | 4 ++++ .lintstagedrc.json | 4 ++++ .pretterignore | 2 ++ 6 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 .editorconfig delete mode 100644 .eslintrc create mode 100644 .eslintrc.js create mode 100755 .husky/pre-commit create mode 100644 .lintstagedrc.json create mode 100644 .pretterignore diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..acdfc7a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# https://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[*.json] +indent_size = 2 \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 7eeefc3..0000000 --- a/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "env": { - "mocha": true - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..f019a46 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,27 @@ +module.exports = { + 'env': { + 'commonjs': true, + 'es2021': true, + 'node': true, + 'mocha': true, + }, + 'extends': ['eslint:recommended', 'google'], + 'overrides': [ + { + 'env': { + 'node': true, + }, + 'files': [ + '.eslintrc.{js,cjs}', + ], + 'parserOptions': { + 'sourceType': 'script', + }, + }, + ], + 'parserOptions': { + 'ecmaVersion': 'latest', + }, + 'rules': { + }, +}; diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..610c2a5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm test diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..bfc7c23 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "*.js": "eslint --fix", + "*.{json,md}": "prettier --write" +} diff --git a/.pretterignore b/.pretterignore new file mode 100644 index 0000000..cce0279 --- /dev/null +++ b/.pretterignore @@ -0,0 +1,2 @@ +package.json +package-lock.json