Skip to content

Commit

Permalink
migrated to new esline format
Browse files Browse the repository at this point in the history
  • Loading branch information
LoaderB0T committed Sep 25, 2024
1 parent ebe843f commit 2379b78
Show file tree
Hide file tree
Showing 8 changed files with 1,150 additions and 69 deletions.
47 changes: 0 additions & 47 deletions eslint-configs/base/.eslintrc.json

This file was deleted.

63 changes: 63 additions & 0 deletions eslint-configs/base/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import globals from "globals";
import js from "@eslint/js";
import unusedImports from "eslint-plugin-unused-imports";

import tseslint from "typescript-eslint";

export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.name,
allowDefaultProject: true,
},
},
},
{
plugins: {
"unused-imports": unusedImports,
},
},
{
files: ["**/*.ts"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
},

rules: {
indent: "off",
quotes: "off",
semi: ["error", "always"],

// Unused vars & imports
"no-unused-vars": ["off"],
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],

curly: "error",
"@typescript-eslint/prefer-readonly": ["error"],
"max-len": "off",
"prefer-template": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
},
},
];
17 changes: 11 additions & 6 deletions eslint-configs/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awdware/eslint-config-base",
"version": "1.2.0",
"version": "2.0.0",
"homepage": "https://github.com/awdware/dev",
"repository": {
"type": "git",
Expand All @@ -10,14 +10,19 @@
"scripts": {
"drop": "pnpm publish --access public"
},
"main": ".eslintrc.json",
"author": "LoaderB0T",
"license": "MIT",
"private": false,
"exports": {
".": {
"import": "./eslint.config.mjs",
"require": "./eslint.config.mjs"
}
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">= 6",
"@typescript-eslint/parser": ">= 6",
"eslint": ">= 8",
"eslint-plugin-unused-imports": ">= 3"
"typescript-eslint": ">= 8.7",
"@types/eslint__js": ">= 8",
"eslint": ">= 9.1",
"eslint-plugin-unused-imports": ">= 4.1"
}
}
13 changes: 0 additions & 13 deletions eslint-configs/nodejs/.eslintrc.json

This file was deleted.

16 changes: 16 additions & 0 deletions eslint-configs/nodejs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import base from "@awdware/eslint-config-base";
import globals from "globals";

export default [
...base,
{
languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: "latest",
sourceType: "module",
},
},
];
11 changes: 8 additions & 3 deletions eslint-configs/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awdware/eslint-config-nodejs",
"version": "1.0.0",
"version": "2.0.0",
"homepage": "https://github.com/awdware/dev",
"repository": {
"type": "git",
Expand All @@ -12,9 +12,14 @@
},
"author": "LoaderB0T",
"license": "MIT",
"main": ".eslintrc.json",
"private": false,
"exports": {
".": {
"import": "./eslint.config.mjs",
"require": "./eslint.config.mjs"
}
},
"peerDependencies": {
"@awdware/eslint-config-base": ">= 1"
"@awdware/eslint-config-base": ">= 2.0.0"
}
}
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@awdware/dev",
"version": "0.0.0",
"homepage": "https://github.com/awdware/dev",
"repository": {
"type": "git",
"url": "https://github.com/awdware/dev.git"
},
"author": "LoaderB0T",
"license": "MIT",
"private": true,
"devDependencies": {
"@types/eslint__js": "^8.42.3",
"eslint": "^9.11.1",
"eslint-plugin-unused-imports": "^4.1.4",
"typescript-eslint": "^8.7.0"
}
}
Loading

0 comments on commit 2379b78

Please sign in to comment.