Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Save as .codeclimate.yml (note leading .) in project root directory
version: "2"
languages:
Ruby: false
JavaScript: true
PHP: false
checks:
file-lines:
config:
threshold: 500
method-lines:
config:
threshold: 75
method-complexity:
config:
threshold: 10
similar-code:
config:
threshold: 65
plugins:
duplication:
enabled: true
config:
languages:
javascript:
mass_threshold: 110
count_threshold: 3
exclude_paths:
- "public/vendor/*"
# Save as .codeclimate.yml (note leading .) in project root directory
version: "2"
languages:
Ruby: false
JavaScript: true
PHP: false
checks:
file-lines:
config:
threshold: 500
method-lines:
config:
threshold: 75
method-complexity:
config:
threshold: 10
similar-code:
config:
threshold: 65
plugins:
duplication:
enabled: true
config:
languages:
javascript:
mass_threshold: 110
count_threshold: 3
exclude_paths:
- "public/vendor/*"
- "test/*"
24 changes: 12 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm

RUN apt-get update \
&& apt-get install -y \
iputils-ping \
redis-server \
&& rm -rf /var/lib/apt/lists/*

RUN curl https://qlty.sh | /bin/bash \
&& mv ~/.qlty/bin/qlty /usr/local/bin/qlty \
&& rm -rf ~/.qlty \
&& qlty --version
FROM mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm
RUN apt-get update \
&& apt-get install -y \
iputils-ping \
redis-server \
&& rm -rf /var/lib/apt/lists/*
RUN curl https://qlty.sh | /bin/bash \
&& mv ~/.qlty/bin/qlty /usr/local/bin/qlty \
&& rm -rf ~/.qlty \
&& qlty --version
18 changes: 9 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
root = true

[{*.js, *.css, *.tpl, *.json, *.ts}]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
root = true
[{*.js, *.css, *.tpl, *.json, *.ts}]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
58 changes: 29 additions & 29 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
node_modules/
*.sublime-project
*.sublime-workspace
.project
.vagrant
.DS_Store
logs/
/public/templates
/public/uploads
/public/vendor
/public/src/modules/string.js
.idea/
.vscode/
*.ipr
*.iws
/coverage
/build
.eslintrc
test/files
*.min.js

/public/src/app.js
/public/src/client.js
/public/src/admin/admin.js
/public/src/modules/translator.common.js
/public/src/modules/pictureCropper.js
/public/src/modules/ace-editor.js
/public/src/client/account/header.js
/public/src/client/test.js
node_modules/
*.sublime-project
*.sublime-workspace
.project
.vagrant
.DS_Store
logs/
/public/templates
/public/uploads
/public/vendor
/public/src/modules/string.js
.idea/
.vscode/
*.ipr
*.iws
/coverage
/build
.eslintrc
test/files
*.min.js
/public/src/app.js
/public/src/client.js
/public/src/admin/admin.js
/public/src/modules/translator.common.js
/public/src/modules/pictureCropper.js
/public/src/modules/ace-editor.js
/public/src/client/account/header.js
/public/src/client/test.js
themes/
138 changes: 69 additions & 69 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@

const fs = require('fs');
const path = require('path');

// Directories that contain TypeScript files of note
const tsDirs = [
"public/src",
"src",
"test",
];

// Helper walk function to check all directories
function walk(dir) {
var results = [];
var list = fs.readdirSync(dir);
list.forEach(function(file) {
file = dir + '/' + file;
var stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
results = results.concat(walk(file));
} else {
results.push(file);
}
});
return results;
}

// Find all JS files that were compiled from TS
function find_compiled_js() {
let jsFilesList = [];

tsDirs.forEach(tsDir => {
let filesList = walk(tsDir);
const tsFilesList = filesList.filter((file) => path.extname(file).toLowerCase() === '.ts');
jsFilesList = jsFilesList.concat(filesList.filter(
(file) => path.extname(file).toLowerCase() === '.js' &&
tsFilesList.find(tsFile => tsFile === (file.replace(/\.[^/.]+$/, "") + ".ts")) !== undefined));
});

if (jsFilesList.length == 0) return "";
return jsFilesList;
}

module.exports = {
extends: ["nodebb"],
root: true,
ignorePatterns: find_compiled_js(),
rules: {
"indent": ["error", 4]
},
overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
ecmaFeatures: { jsx: true },
project: "./tsconfig.json"
},
rules: {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",
}
}
]
const fs = require('fs');
const path = require('path');
// Directories that contain TypeScript files of note
const tsDirs = [
"public/src",
"src",
"test",
];
// Helper walk function to check all directories
function walk(dir) {
var results = [];
var list = fs.readdirSync(dir);
list.forEach(function(file) {
file = dir + '/' + file;
var stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
results = results.concat(walk(file));
} else {
results.push(file);
}
});
return results;
}
// Find all JS files that were compiled from TS
function find_compiled_js() {
let jsFilesList = [];
tsDirs.forEach(tsDir => {
let filesList = walk(tsDir);
const tsFilesList = filesList.filter((file) => path.extname(file).toLowerCase() === '.ts');
jsFilesList = jsFilesList.concat(filesList.filter(
(file) => path.extname(file).toLowerCase() === '.js' &&
tsFilesList.find(tsFile => tsFile === (file.replace(/\.[^/.]+$/, "") + ".ts")) !== undefined));
});
if (jsFilesList.length == 0) return "";
return jsFilesList;
}
module.exports = {
extends: ["nodebb"],
root: true,
ignorePatterns: find_compiled_js(),
rules: {
"indent": ["error", 4]
},
overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
ecmaFeatures: { jsx: true },
project: "./tsconfig.json"
},
rules: {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",
}
}
]
};
24 changes: 12 additions & 12 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# These files are text and should be normalized (convert crlf => lf)
*.json text
*.css text
*.less text
*.tpl text
*.html text
*.js text
*.md text

# Images should be treated as binary
# (binary is a macro for -text -diff)
*.png binary
# These files are text and should be normalized (convert crlf => lf)
*.json text
*.css text
*.less text
*.tpl text
*.html text
*.js text
*.md text
# Images should be treated as binary
# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
Loading
Loading