Skip to content

Commit

Permalink
feat: convert config to YAML and cleanup (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusrbrown authored Jul 31, 2023
1 parent 5f06121 commit 0468748
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
[*.{js,json,yaml,yml}]
charset = utf-8
indent_style = space
indent_size = 2
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc.json

This file was deleted.

53 changes: 53 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
root: true
env:
node: true
es6: true
'jest/globals': true
extends: ['eslint:recommended', 'plugin:jest/recommended', 'plugin:@typescript-eslint/recommended']
ignorePatterns: ['__tests__', '.yarn', 'dist', 'lib', 'node_modules', 'jest.config.js']
plugins: ['jest', '@typescript-eslint']
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2018
sourceType: module
project: './tsconfig.json'
rules:
'i18n-text/no-en': 'off'
'eslint-comments/no-use': 'off'
'import/no-namespace': 'off'
'no-unused-vars': 'off'
'@typescript-eslint/no-unused-vars': 'error'
'@typescript-eslint/explicit-member-accessibility': ['error', {'accessibility': 'no-public'}]
'@typescript-eslint/no-require-imports': 'error'
'@typescript-eslint/array-type': 'error'
'@typescript-eslint/await-thenable': 'error'
'@typescript-eslint/ban-ts-comment': 'error'
'camelcase': 'off'
'@typescript-eslint/consistent-type-assertions': 'error'
'@typescript-eslint/explicit-function-return-type': ['error', {'allowExpressions': true}]
'@typescript-eslint/func-call-spacing': ['error', 'never']
'@typescript-eslint/no-array-constructor': 'error'
'@typescript-eslint/no-empty-interface': 'error'
'@typescript-eslint/no-explicit-any': 'error'
'@typescript-eslint/no-extraneous-class': 'error'
'@typescript-eslint/no-for-in-array': 'error'
'@typescript-eslint/no-inferrable-types': 'error'
'@typescript-eslint/no-misused-new': 'error'
'@typescript-eslint/no-namespace': 'error'
'@typescript-eslint/no-non-null-assertion': 'warn'
'@typescript-eslint/no-unnecessary-qualifier': 'error'
'@typescript-eslint/no-unnecessary-type-assertion': 'error'
'@typescript-eslint/no-useless-constructor': 'error'
'@typescript-eslint/no-var-requires': 'error'
'@typescript-eslint/prefer-for-of': 'warn'
'@typescript-eslint/prefer-function-type': 'warn'
'@typescript-eslint/prefer-includes': 'error'
'@typescript-eslint/prefer-string-starts-ends-with': 'error'
'@typescript-eslint/promise-function-async': 'error'
'@typescript-eslint/require-array-sort-compare': 'error'
'@typescript-eslint/restrict-plus-operands': 'error'
'semi': 'off'
'@typescript-eslint/semi': ['error', 'never']
'@typescript-eslint/type-annotation-spacing': 'error'
'@typescript-eslint/unbound-method': 'error'
4 changes: 1 addition & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>bfra-me/renovate-config"
]
"extends": ["local>bfra-me/renovate-config"]
}
64 changes: 32 additions & 32 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,35 @@ jobs:
language: [TypeScript]

steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
with:
languages: ${{ matrix.language }}
source-root: src
# 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@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2

# ℹ️ 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@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
with:
languages: ${{ matrix.language }}
source-root: src
# 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@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2

# ℹ️ 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@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2.21.2
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.yarn/
dist/
lib/
node_modules/
node_modules/
10 changes: 0 additions & 10 deletions .prettierrc.json

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
arrowParens: avoid
bracketSpacing: false
overrides:
- files:
- '*.json'
options:
singleQuote: false
trailingComma: none
- files:
- '.vscode/*.json'
options:
tabWidth: 4
printWidth: 120
semi: false
singleQuote: true
tabWidth: 2
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ nodeLinker: pnpm

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
spec: '@yarnpkg/plugin-typescript'

yarnPath: .yarn/releases/yarn-3.6.1.cjs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Use this template to bootstrap the creation of a TypeScript action. :rocket:

This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance.

If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)

## Create an action from this template

Expand Down
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('test runs', () => {
const np = process.execPath
const ip = path.join(__dirname, '..', 'dist', 'index.js')
const options: cp.ExecFileSyncOptions = {
env: process.env
env: process.env,
}
console.log(cp.execFileSync(np, [ip], options).toString())
})
File renamed without changes.
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.ts$': 'ts-jest'
'^.+\\.ts$': 'ts-jest',
},
verbose: true
}
verbose: true,
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"main": "dist/index.js",
"scripts": {
"build": "ncc build --license licenses.txt -o dist src/main.ts",
"format": "prettier --write '**/*.ts'",
"check-format": "prettier --check '**/*.ts'",
"lint": "eslint src/**/*.ts",
"format": "prettier --write .",
"check-format": "prettier --check .",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"test": "jest"
},
"repository": {
Expand Down
16 changes: 8 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"target": "es6",
"module": "commonjs",
"outDir": "./lib",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "**/*.test.ts"]
"exclude": ["node_modules", "**/*.test.ts"],
"include": ["src"]
}

0 comments on commit 0468748

Please sign in to comment.