Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
davikstone2 committed Jan 23, 2024
1 parent ddbea9b commit ce9ea86
Show file tree
Hide file tree
Showing 1,728 changed files with 2,245,206 additions and 1,613,882 deletions.
13 changes: 13 additions & 0 deletions .editorConfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Matches multiple files with brace expansion notation
[*.{js,jsx,ts,tsx,json,css,md,html,vue}]
charset = utf-8
indent_style = tab
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
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/*
54 changes: 27 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
module.exports = {
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", 2], // Use 2 spaces for indentation
"linebreak-style": ["error", "unix"], // Use Unix line endings
quotes: ["error", "double"], // Use single quotes for strings
semi: ["error", "always"], // Require semicolons at the end of statements
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 specific rules
"@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
},
// TypeScript specific rules
'@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", "feature/add-eslint" ]
pull_request:
branches: [ staging ,"master", "feature/add-eslint"]
push:
branches: ['staging', 'master', 'feature/add-eslint']
pull_request:
branches: [staging, 'master', 'feature/add-eslint']

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
16 changes: 11 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
**/*.html
**/*.css
node_modules/
built/
bundler/
node_modules
built/*
bundler/*
coverage/*
*.min.js
.editorconfig
.vscode
mods/**/src/**
.DS_Store
/webpack/*
/web/*
22 changes: 17 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
{
"tabWidth": 2,
"singleQuote": false,
"semi": true,
"trailingComma": "all",
"printWidth": 100
"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"
}
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 ce9ea86

Please sign in to comment.