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

Feature/test eslint #2303

Merged
merged 9 commits into from
Jan 23, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading