-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EREGCSC-1509 -- ESLint Enhancements (#1535)
* chore: remove prettier, update ESLint rules * chore: begin working through ESLint issues * chore: bump javascript-test checkout action ver * chore: continue formatting Vue/JS based on ESLint rules * chore: eslint-global-rules file at project root * chore: fix all fixable things * chore: remove prettier from package.json * chore: add eslint make commant * chore: add ESLint action * chore: add actual yml file * chore: tweak job name in yml * fix: first fixes due to ESLint action * chore: add eslint to cdk-eregs package.json * chore: more global eslint rules up one dir * chore: add basic eslint config to CDK directory * chore: first pass as CDK linting in GitHub action * fix: tweak eslint github action pathing * chore: remove debug flag from cdk eslint cmd * test: tweak Cypress search test suite * fix: remove duplicate rule * chore: small tweak to cdk eslint config * chore: indent rules * chore: make four-space indent mandatory for js/vue only * chore: update make file * chore: add editorconfig for js/ts spacing diff default * chore: update code comment * chore: update cdk-eregs ESLint to handle JS better * chore: add ESLint JS rules to front end eslint config also update lib vers * chore: further linting and formatting * chore: update ESLint documentation * fix: relative path in README to another md file * fix: relative path in README to another md file * chore: disable CDK linting for now
- Loading branch information
Showing
97 changed files
with
2,279 additions
and
1,113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# 2 space indentation for .ts files | ||
[*.ts] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# 4 space indentation for .js/.cjs/.mjs files | ||
[*.{js,cjs,mjs}] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: "ESLint" | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened ] | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
lint-eslint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
# Checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
# Setup node environment | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
# Execute linting | ||
- name: Run ESLint on front end | ||
if: success() | ||
working-directory: ./solution | ||
run: | | ||
make eslint-frontend | ||
- name: Run ESLint on CDK TS files | ||
# if: success() | ||
if: false # Disable CDK linting for now | ||
working-directory: ./solution | ||
run: | | ||
make eslint-cdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import globalConfig from "../eslint-global-rules.mjs"; | ||
|
||
export default [ | ||
{ files: ["**/*.{js,mjs,cjs,ts}"] }, | ||
{ languageOptions: { globals: globals.browser } }, | ||
...tseslint.configs.recommended, | ||
{ | ||
files: ["**/*.js"], | ||
rules: { | ||
...pluginJs.configs.recommended.rules, | ||
"indent": ["error", 4, { SwitchCase: 1 }], | ||
} | ||
}, | ||
{ | ||
rules: { | ||
...globalConfig, | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
module.exports = { | ||
testEnvironment: 'node', | ||
roots: ['<rootDir>/test'], | ||
testMatch: ['**/*.test.ts'], | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest' | ||
} | ||
testEnvironment: 'node', | ||
roots: ['<rootDir>/test'], | ||
testMatch: ['**/*.test.ts'], | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest' | ||
} | ||
}; |
Oops, something went wrong.