Skip to content

Commit

Permalink
Update and convert to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Apr 1, 2022
1 parent d5a2a2d commit 9d71e76
Show file tree
Hide file tree
Showing 30 changed files with 7,566 additions and 5,920 deletions.
26 changes: 8 additions & 18 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Project wide settings
[**]
end_of_line = lf
insert_final_newline = false
trim_trailing_whitespace = true
[*]
indent_style = space
indent_size = 4
max_line_length = 80

# Markdown nonsense
[**.md]
indent_size = 2

# Go with how NPM indents package.json
[package.json]
indent_size = 2

# Go with how travis indents .travis.yml
[.travis.yml]
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
.test
coverage
128 changes: 128 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
root: true

extends:
- plugin:node/recommended
- plugin:github/recommended
- plugin:promise/recommended
- plugin:regexp/recommended
- plugin:array-func/recommended
- plugin:optimize-regex/recommended
- plugin:import/recommended
- plugin:unicorn/recommended
- plugin:security/recommended
- plugin:sonarjs/recommended
- plugin:ava/recommended
- xo
- prettier

plugins:
- node
- github
- promise
- regexp
- array-func
- optimize-regex
- no-constructor-bind
- import
- unicorn
- security
- no-secrets
- sonarjs
- ava
- notice

parser: '@typescript-eslint/parser'

parserOptions:
ecmaVersion: 2020
project: './tsconfig.eslint.json'

overrides:
- files: '*.ts'
extends:
- plugin:github/typescript
- plugin:import/typescript
- xo-typescript
- prettier
parserOptions:
ecmaVersion: 2020
project: './tsconfig.eslint.json'
rules:
'@typescript-eslint/naming-convention':
[
error,
{ selector: default, format: [camelCase] },
{ selector: objectLiteralProperty, format: null },
{ selector: enumMember, format: [PascalCase] },
{ selector: typeProperty, format: null },

{
selector: variableLike,
format: [camelCase, UPPER_CASE],
leadingUnderscore: allow,
},
{
selector: parameter,
format: [camelCase],
leadingUnderscore: allow,
},

{
selector: memberLike,
modifiers: [private],
format: [camelCase],
leadingUnderscore: require,
},

{ selector: typeLike, format: [PascalCase] },
]
'@typescript-eslint/restrict-template-expressions': off
'@typescript-eslint/no-shadow': warn

rules:
notice/notice:
- error
- template: |
/**
* @license
* Copyright <%= YEAR %> Open Ag Data Alliance
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
onNonMatchingHeader: append
nonMatchingTolerance: 0.7
unicorn/prefer-node-protocol: off
sonarjs/no-duplicate-string: [warn, 5]
sonarjs/cognitive-complexity: warn
eslint-comments/no-unused-disable: off
import/extensions: off
node/no-unpublished-import: off
spaced-comment: [error, always, markers: [/, //]]
filenames/match-regex: off
unicorn/filename-case: off
i18n-text/no-en: off
eslint-comments/no-use: off
no-secrets/no-secrets: error
no-empty-label: off
no-return-await: off
no-warning-comments: off
node/no-missing-import: off
import/no-unresolved: off
unicorn/prefer-spread: off
no-constructor-bind/no-constructor-bind: error
no-constructor-bind/no-constructor-state: error
sort-imports: [warn, { allowSeparatedGroups: true }]
ava/no-ignored-test-files: off
ava/no-import-test-files: off
ava/no-skip-test: warn
ava/no-skip-assert: warn
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '25 20 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit 9d71e76

Please sign in to comment.