-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ignore node_modules * add eslint * add workflow * fix findings
- Loading branch information
Showing
8 changed files
with
2,768 additions
and
109 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,15 @@ | ||
env: | ||
browser: true | ||
es2022: true | ||
node: true | ||
jest: true | ||
extends: | ||
- standard | ||
parserOptions: | ||
sourceType: module | ||
ecmaVersion: 2022 | ||
globals: | ||
Module: true | ||
Log: true | ||
rules: | ||
"comma-dangle": ["error", "always-multiline"] |
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,28 @@ | ||
name: "Validation" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
env: | ||
node-version: 18.x | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
name: 'ESLint' | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ env.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node-version }} | ||
cache: "npm" | ||
- name: Install Dependencies | ||
run: npm clean-install | ||
- name: Validate JS Sources | ||
run: npm run validate:js |
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,2 @@ | ||
# Ignore all node modules. | ||
node_modules |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// add string format method | ||
if (!String.prototype.format) { | ||
String.prototype.format = function() { | ||
var args = arguments; | ||
return this.replace(/{(\d+)}/g, function(match, number) { | ||
return typeof args[number] != 'undefined' | ||
? args[number] | ||
: match | ||
; | ||
}); | ||
}; | ||
// eslint-disable-next-line no-extend-native | ||
String.prototype.format = function () { | ||
const args = arguments | ||
return this.replace(/{(\d+)}/g, function (match, number) { | ||
return typeof args[number] !== 'undefined' | ||
? args[number] | ||
: match | ||
}) | ||
} | ||
} |
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
Oops, something went wrong.