Skip to content

Commit

Permalink
Merge branch 'Gandi-IDE:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HanHanDeYaYa authored Jun 12, 2024
2 parents d8968ed + 1a208e4 commit a2680f8
Show file tree
Hide file tree
Showing 24 changed files with 33,664 additions and 3,204 deletions.
71 changes: 71 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// eslint-disable-next-line no-undef
module.exports = {
env: {
es2021: true,
browser: true,
},
extends: "eslint:recommended",
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: {
Blockly: "readonly",
Scratch: "readonly",
},
rules: {
// Unused variables commonly indicate logic errors
"no-unused-vars": [
"error",
{
// Unused arguments are useful, eg. it can be nice for blocks to accept `args` even if they don't use it
args: "none",
// Allow silently eating try { } catch { }
caughtErrors: "none",
// Variables starting with _ are intentionally unused
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
// Allow while (true) { }
"no-constant-condition": [
"error",
{
checkLoops: false,
},
],
// Allow empty catch {} blocks
"no-empty": [
"error",
{
allowEmptyCatch: true,
},
],
// Returning a value from a constructor() implies a mistake
"no-constructor-return": "error",
// new Promise(async () => {}) implies a mistake
"no-async-promise-executor": "warn",
// x === x implies a mistake
"no-self-compare": "error",
// Using ${...} in a non-template-string implies a mistake
"no-template-curly-in-string": "error",
// Loops that only iterate once imply a mistake
"no-unreachable-loop": "error",
// Detect some untrusted code execution
"no-eval": "error",
"no-implied-eval": "error",
"no-new-func": "error",
"no-script-url": "error",
// Combinations of || and && are unreadable and may not do what you expect
"no-mixed-operators": [
"error",
{
groups: [["&&", "||"]],
},
],
// Disallow async functions that don't need to be. This is important as a Promise and non-Promise return value
// significantly impacts the behavior of projects.
"require-await": "error",
},
};
52 changes: 52 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Originally from https://github.com/TurboWarp/extensions

name: Validate

on:
pull_request:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate
run: npm run validate

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate
run: npm run lint

format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Validate
run: npm run check-format
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ node_modules
/coverage

# production
/dist
dist/


/types

Expand Down
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"trailingComma": "es5",
"endOfLine": "auto"
}
Loading

0 comments on commit a2680f8

Please sign in to comment.