Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump node to LTS and update lint config #139

Merged
merged 4 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
module.exports = {
parser: '@babel/eslint-parser',
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
ecmaVersion: 'latest',
ecmaFeatures: {
globalReturn: false,
jsx: true,
},
requireConfigFile: false,
sourceType: 'module',
babelOptions: { presets: ['@babel/preset-react', '@babel/preset-typescript'] },
babelOptions: {presets: ['@babel/preset-react', '@babel/preset-typescript']},
project: './tsconfig.json',
},
env: {
es6: true,
browser: true,
},
globals: {},
extends: ['prettier'],
extends: ['eslint:recommended', 'plugin:react/recommended', 'standard-with-typescript', 'plugin:import/typescript', 'plugin:prettier/recommended'],
plugins: ['react', 'react-hooks', 'prettier'],
ignorePatterns: ['tsconfig.json', '.eslintrc.js', 'todos.ts'],
rules: {
'prettier/prettier': 2,
semi: 2,
'prettier/prettier': 0,
semi: 0,
'comma-dangle': ['error', 'only-multiline'],
'react/jsx-uses-vars': 1,
'no-unused-vars': 1,
'no-unused-vars': 2,
'no-undef': 0,
'no-unexpected-multiline': 1,
'no-debugger': 2,
'no-alert': 1,
'no-console': 1,
'no-await-in-loop': 1,
'no-return-assign': ['error', 'except-parens'],
'no-unused-expressions': [2, { allowTaggedTemplates: true }],
'no-unused-expressions': [2, {allowTaggedTemplates: true}],
'import/prefer-default-export': 0,
import: 0,
'react/require-default-props': 0,
Expand All @@ -57,15 +58,25 @@ module.exports = {
],
camelcase: 1,
'template-curly-spacing': 'off',
indent: ['error', 2, { ignoredNodes: ['TemplateLiteral'] }],
indent: ['error', 2, {ignoredNodes: ['TemplateLiteral']}],
'max-len': [
2,
1,
{
code: 120,
code: 150,
tabWidth: 2,
ignoreTemplateLiterals: true,
},
],
'react/no-unescaped-entities': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/strict-boolean-expressions': 0,
'@typescript-eslint/prefer-nullish-coalescing': 0,
'@typescript-eslint/naming-convention': 1,
'@typescript-eslint/triple-slash-reference': 0,
'@typescript-eslint/no-unsafe-assignment': 1,
'@typescript-eslint/no-unsafe-argument': 1,
'@typescript-eslint/no-floating-promises': 1,
'@typescript-eslint/no-misused-promises': 1,
},
settings: {
'import/resolver': 'webpack',
Expand All @@ -76,11 +87,7 @@ module.exports = {
version: 'detect',
flowVersion: '0.53',
},
propWrapperFunctions: [
'forbidExtraProps',
{ property: 'freeze', object: 'Object' },
{ property: 'myFavoriteWrapper' },
],
linkComponents: ['Hyperlink', { name: 'Link', linkAttribute: 'to' }],
propWrapperFunctions: ['forbidExtraProps', {property: 'freeze', object: 'Object'}, {property: 'myFavoriteWrapper'}],
linkComponents: ['Hyperlink', {name: 'Link', linkAttribute: 'to'}],
},
};
65 changes: 32 additions & 33 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: ['master']
schedule:
- cron: '44 15 * * 0'

Expand All @@ -32,43 +32,42 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.


# 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@v2
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# 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@v2

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
11 changes: 0 additions & 11 deletions .github/workflows/dependabot.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: "Perform Lint and Run Tests"
name: 'Perform Lint and Run Tests'
on:
pull_request:
branches:
- "master"
- 'master'
jobs:
test:
strategy:
matrix:
node-version:
- 14
- 20.10.x
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -19,7 +19,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
run: npm install --legacy-peer-deps
- name: Perform linting
run: npm run lint:fix
- name: Run Tests
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
. "$(dirname -- "$0")/_/husky.sh"

npm test
npm run lint
npm run lint:fix
npm run prepare:typesync
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.17.0
v20.10.0
13 changes: 13 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
arrowParens: 'always',
bracketSameLine: false,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
tabWidth: 2,
useTabs: false,
semi: true,
printWidth: 150,
quoteProps: 'as-needed',
jsxSingleQuote: true,
};
Loading
Loading