Skip to content

Commit

Permalink
Port the configuration files to JS [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Jan 25, 2024
1 parent 5a83055 commit 4d3e781
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 42 deletions.
56 changes: 28 additions & 28 deletions etc/eslint.json → etc/eslint.cjs
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"root": true,
"env": {
"es2024": true,
"node": true
module.exports = {
root: true,
env: {
es2024: true,
node: true
},
"extends": [
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
overrides: [
{
"files": ["*.cts", "*.mts", "*.ts", "*.tsx"],
"rules": {
files: ["*.cts", "*.mts", "*.ts", "*.tsx"],
rules: {
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"project": "tsconfig.json",
"sourceType": "module"
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
project: "tsconfig.json",
sourceType: "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
plugins: ["@typescript-eslint"],
rules: {
"array-callback-return": "error",
"no-await-in-loop": "off",
"no-constant-binary-expression": "off",
Expand All @@ -38,7 +38,7 @@
"no-unreachable-loop": "error",
"no-unused-private-class-members": "error",
"no-use-before-define": "off",
"require-atomic-updates": ["error", {"allowProperties": true}],
"require-atomic-updates": ["error", {allowProperties: true}],

"accessor-pairs": "error",
"arrow-body-style": "error",
Expand All @@ -57,22 +57,22 @@
"eqeqeq": "off",
"func-name-matching": "error",
"func-names": "off",
"func-style": ["error", "declaration", {"allowArrowFunctions": true}],
"func-style": ["error", "declaration", {allowArrowFunctions: true}],
"grouped-accessor-pairs": "error",
"guard-for-in": "error",
"id-denylist": "off",
"id-length": ["error", {"exceptions": ["_"]}],
"id-length": ["error", {exceptions: ["_"]}],
"id-match": "error",
"init-declarations": "error",
"max-classes-per-file": "off",
"max-depth": "error",
"max-lines": ["error", {"max": 500}],
"max-lines-per-function": ["error", {"max": 100}],
"max-lines": ["error", {max: 500}],
"max-lines-per-function": ["error", {max: 100}],
"max-nested-callbacks": "error",
"max-params": ["error", 4],
"max-statements": ["error", {"max": 25}],
"max-statements": ["error", {max: 25}],
"multiline-comment-style": ["error", "separate-lines"],
"new-cap": ["error", {"capIsNewExceptions": ["RangeError", "SyntaxError", "TypeError"]}],
"new-cap": ["error", {capIsNewExceptions: ["RangeError", "SyntaxError", "TypeError"]}],
"no-alert": "error",
"no-array-constructor": "error",
"no-caller": "error",
Expand Down Expand Up @@ -100,7 +100,7 @@
"no-lonely-if": "error",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-multi-assign": ["error", {"ignoreNonDeclaration": true}],
"no-multi-assign": ["error", {ignoreNonDeclaration: true}],
"no-multi-str": "error",
"no-negated-condition": "off",
"no-nested-ternary": "off",
Expand Down Expand Up @@ -181,7 +181,7 @@
"@typescript-eslint/default-param-last": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/explicit-member-accessibility": ["error", {accessibility: "no-public"}],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/init-declarations": "error",
"@typescript-eslint/max-params": "error",
Expand All @@ -190,7 +190,7 @@
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-array-delete": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-confusing-void-expression": ["error", {"ignoreArrowShorthand": true}],
"@typescript-eslint/no-confusing-void-expression": ["error", {ignoreArrowShorthand: true}],
"@typescript-eslint/no-dupe-class-members": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-empty-function": "error",
Expand Down Expand Up @@ -218,7 +218,7 @@
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-unsafe-unary-minus": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": ["error", {"functions": false}],
"@typescript-eslint/no-use-before-define": ["error", {functions: false}],
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/no-useless-template-literals": "error",
Expand Down Expand Up @@ -250,4 +250,4 @@
"@typescript-eslint/typedef": "error",
"@typescript-eslint/unified-signatures": "error"
}
}
};
13 changes: 13 additions & 0 deletions etc/typedoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @type {Partial<import("typedoc").TypeDocOptions>}
*/
export default {
entryPoints: ["../src/index.ts"],
excludePrivate: true,
gitRevision: "main",
hideGenerator: true,
name: "Akismet for JS",
out: "../docs/api",
readme: "none",
tsconfig: "../src/tsconfig.json"
};
11 changes: 0 additions & 11 deletions etc/typedoc.json

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"scripts": {
"build": "node tool/build.js && tsc --project src/tsconfig.json",
"clean": "node tool/clean.js",
"doc": "typedoc --options etc/typedoc.json && node tool/doc.js",
"doc": "typedoc --options etc/typedoc.js && node tool/doc.js",
"dist": "npm run clean && npm run build",
"lint": "tsc --project tsconfig.json && eslint --config=etc/eslint.json example src test tool",
"lint": "tsc --project tsconfig.json && eslint --config=etc/eslint.cjs etc example src test tool",
"postpublish": "node tool/publish.js",
"prepack": "npm run dist",
"test": "npm run build && node --test --test-reporter=spec"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["example/*.js", "src/**/*.ts", "test/**/*.js", "tool/*.js"],
"include": ["etc/*.js", "example/*.js", "src/**/*.ts", "test/**/*.js", "tool/*.js"],
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
Expand Down

0 comments on commit 4d3e781

Please sign in to comment.