Skip to content

Commit

Permalink
Feature/test eslint (#2303)
Browse files Browse the repository at this point in the history
* update

* prettier

* update

* update link workflow

* update link workflow

* add husty prepush

* eslint fix

* update

* update qrcode
  • Loading branch information
davikstone2 authored Jan 23, 2024
1 parent dca0af2 commit e82446d
Show file tree
Hide file tree
Showing 956 changed files with 1,840,936 additions and 1,354,810 deletions.
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
built/*
bundler/*
coverage/*
*.min.js
.editorconfig
.vscode
mods/**/src/**
.DS_Store
/webpack/*
/web/*
48 changes: 27 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
jquery: true,
},
extends: [
// 'airbnb-base',
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 13,
sourceType: "module",
},
plugins: ["@typescript-eslint"],
rules: {
"prefer-const": 0,
},
env: {
browser: true,
es2021: true,
node: true,
jquery: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 13,
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
rules: {
// Basic code style rules
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'], // Use Unix line endings
quotes: ['error', 'single', { allowTemplateLiterals: true }], // Use single quotes for strings
semi: ['error', 'always'] // Require semicolons at the end of statements

// '@typescript-eslint/no-unused-vars': 'off', // Turn off unused variable warnings
// '@typescript-eslint/no-empty-function': 'off', // Allow empty functions
// '@typescript-eslint/no-var-requires': 'off', // Allow 'require' statements
// '@typescript-eslint/no-this-alias': 'off', // Allow using 'this' alias
// 'no-fallthrough': 'off', // Allow fallthrough in switch statements
// 'no-prototype-builtins': 'off', // Allow prototype built-ins
// 'no-cond-assign': 'off' // Allow assignment in conditional expressions
}
};
40 changes: 20 additions & 20 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Lint

on:
push:
branches: [ "staging","master" ]
pull_request:
branches: [ staging ,"master"]
push:
branches: [staging, master]
pull_request:
branches: [staging, master]

jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
lint:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Run ESLint
run: npx eslint . --config .eslintrc.js
- name: Run ESLint
run: npx eslint . --config .eslintrc.js
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
built/*
bundler/*
coverage/*
*.min.js
.editorconfig
.vscode
mods/**/src/**
.DS_Store
/webpack/*
/web/*
19 changes: 19 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"useTabs": true,
"tabWidth": 4,
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"insertPragma": false,
"requirePragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"embeddedLanguageFormatting": "auto"
}
3 changes: 0 additions & 3 deletions .prettierrc.json

This file was deleted.

34 changes: 17 additions & 17 deletions apps/core/hash-loader.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import S from "saito-js/saito";
import S from 'saito-js/saito';

export default async (saito) => {
saito.hash = (data) => S.hash(data);
// if (!saito.BROWSER) {
// // eslint-disable-next-line @typescript-eslint/no-var-requires
// const blake3 = require("blake3");
// saito.hash = (data) => {
// return blake3.hash(data).toString("hex");
// };
// } else {
// const blake3 = await import("blake3/browser");
// saito.hash = (data) => {
// // console.log(blake3);
// // console.log(data);
// return blake3.hash(data).toString("hex");
// };
//
// }
saito.hash = (data) => S.hash(data);
// if (!saito.BROWSER) {
// // eslint-disable-next-line @typescript-eslint/no-var-requires
// const blake3 = require("blake3");
// saito.hash = (data) => {
// return blake3.hash(data).toString("hex");
// };
// } else {
// const blake3 = await import("blake3/browser");
// saito.hash = (data) => {
// // console.log(blake3);
// // console.log(data);
// return blake3.hash(data).toString("hex");
// };
//
// }
};
Loading

0 comments on commit e82446d

Please sign in to comment.