@alextheman/eslint-plugin 2.7.1 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +32 -5
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -3758,7 +3758,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
3758
3758
|
|
|
3759
3759
|
// package.json
|
|
3760
3760
|
var name = "@alextheman/eslint-plugin";
|
|
3761
|
-
var version = "2.7.
|
|
3761
|
+
var version = "2.7.3";
|
|
3762
3762
|
|
|
3763
3763
|
// src/configs/index.ts
|
|
3764
3764
|
var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-json"), 1);
|
|
@@ -4129,19 +4129,46 @@ var typeScriptBase = [
|
|
|
4129
4129
|
var typeScriptBase_default = typeScriptBase;
|
|
4130
4130
|
|
|
4131
4131
|
// src/configs/personal/eslintPlugin.ts
|
|
4132
|
+
var import_eslint_plugin_perfectionist2 = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
4132
4133
|
function createPersonalEslintPluginConfig(plugin) {
|
|
4134
|
+
const noPluginImportMessage = "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.";
|
|
4133
4135
|
return [
|
|
4134
4136
|
{
|
|
4135
4137
|
plugins: {
|
|
4136
|
-
"@alextheman": plugin
|
|
4138
|
+
"@alextheman": plugin,
|
|
4139
|
+
perfectionist: import_eslint_plugin_perfectionist2.default
|
|
4137
4140
|
},
|
|
4138
4141
|
rules: {
|
|
4139
|
-
// When we pass the plugin into the config creator functions from the index, there's no guarantee that the configs will already be
|
|
4140
|
-
// on the plugin when you access them from src/configs, since they're in the process of being created. It is generally better to import
|
|
4141
|
-
// another creator function directly from the creator function should you need to refer to another config in the newly added config. */
|
|
4142
4142
|
"@alextheman/no-plugin-configs-access-from-src-configs": "error"
|
|
4143
4143
|
}
|
|
4144
4144
|
},
|
|
4145
|
+
{
|
|
4146
|
+
files: ["src/configs/**"],
|
|
4147
|
+
rules: {
|
|
4148
|
+
"no-restricted-imports": [
|
|
4149
|
+
"error",
|
|
4150
|
+
{
|
|
4151
|
+
paths: [
|
|
4152
|
+
{
|
|
4153
|
+
importNames: ["default"],
|
|
4154
|
+
message: noPluginImportMessage,
|
|
4155
|
+
name: "src/alexPlugin"
|
|
4156
|
+
},
|
|
4157
|
+
{
|
|
4158
|
+
importNames: ["default"],
|
|
4159
|
+
message: noPluginImportMessage,
|
|
4160
|
+
name: "src/index"
|
|
4161
|
+
},
|
|
4162
|
+
{
|
|
4163
|
+
importNames: ["default"],
|
|
4164
|
+
message: noPluginImportMessage,
|
|
4165
|
+
name: "src"
|
|
4166
|
+
}
|
|
4167
|
+
]
|
|
4168
|
+
}
|
|
4169
|
+
]
|
|
4170
|
+
}
|
|
4171
|
+
},
|
|
4145
4172
|
{
|
|
4146
4173
|
// Since the object exported in the rules index serves the same function as the exports in other projects, it's best to sort them in alphabetical order
|
|
4147
4174
|
// as well to make it easier to compare against the file directory.
|
package/dist/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { Config } from 'prettier';
|
|
|
4
4
|
import z from 'zod';
|
|
5
5
|
|
|
6
6
|
var name = "@alextheman/eslint-plugin";
|
|
7
|
-
var version = "2.7.
|
|
7
|
+
var version = "2.7.3";
|
|
8
8
|
|
|
9
9
|
type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
10
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Config } from 'prettier';
|
|
|
4
4
|
import z from 'zod';
|
|
5
5
|
|
|
6
6
|
var name = "@alextheman/eslint-plugin";
|
|
7
|
-
var version = "2.7.
|
|
7
|
+
var version = "2.7.3";
|
|
8
8
|
|
|
9
9
|
type CamelToKebab<S extends string> = S extends `${IgnoreCase<"J">}avaScript${infer Rest}` ? Rest extends "" ? "javascript" : `javascript${CamelToKebab<Rest>}` : S extends `${IgnoreCase<"T">}ypeScript${infer Rest}` ? Rest extends "" ? "typescript" : `typescript${CamelToKebab<Rest>}` : S extends `${infer Head}${infer Tail}` ? Head extends Lowercase<Head> ? `${Head}${CamelToKebab<Tail>}` : `-${Lowercase<Head>}${CamelToKebab<Tail>}` : S;
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -3743,7 +3743,7 @@ var require_src = __commonJS({
|
|
|
3743
3743
|
|
|
3744
3744
|
// package.json
|
|
3745
3745
|
var name = "@alextheman/eslint-plugin";
|
|
3746
|
-
var version = "2.7.
|
|
3746
|
+
var version = "2.7.3";
|
|
3747
3747
|
|
|
3748
3748
|
// src/configs/index.ts
|
|
3749
3749
|
import packageJson from "eslint-plugin-package-json";
|
|
@@ -4114,19 +4114,46 @@ var typeScriptBase = [
|
|
|
4114
4114
|
var typeScriptBase_default = typeScriptBase;
|
|
4115
4115
|
|
|
4116
4116
|
// src/configs/personal/eslintPlugin.ts
|
|
4117
|
+
import perfectionist2 from "eslint-plugin-perfectionist";
|
|
4117
4118
|
function createPersonalEslintPluginConfig(plugin) {
|
|
4119
|
+
const noPluginImportMessage = "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.";
|
|
4118
4120
|
return [
|
|
4119
4121
|
{
|
|
4120
4122
|
plugins: {
|
|
4121
|
-
"@alextheman": plugin
|
|
4123
|
+
"@alextheman": plugin,
|
|
4124
|
+
perfectionist: perfectionist2
|
|
4122
4125
|
},
|
|
4123
4126
|
rules: {
|
|
4124
|
-
// When we pass the plugin into the config creator functions from the index, there's no guarantee that the configs will already be
|
|
4125
|
-
// on the plugin when you access them from src/configs, since they're in the process of being created. It is generally better to import
|
|
4126
|
-
// another creator function directly from the creator function should you need to refer to another config in the newly added config. */
|
|
4127
4127
|
"@alextheman/no-plugin-configs-access-from-src-configs": "error"
|
|
4128
4128
|
}
|
|
4129
4129
|
},
|
|
4130
|
+
{
|
|
4131
|
+
files: ["src/configs/**"],
|
|
4132
|
+
rules: {
|
|
4133
|
+
"no-restricted-imports": [
|
|
4134
|
+
"error",
|
|
4135
|
+
{
|
|
4136
|
+
paths: [
|
|
4137
|
+
{
|
|
4138
|
+
importNames: ["default"],
|
|
4139
|
+
message: noPluginImportMessage,
|
|
4140
|
+
name: "src/alexPlugin"
|
|
4141
|
+
},
|
|
4142
|
+
{
|
|
4143
|
+
importNames: ["default"],
|
|
4144
|
+
message: noPluginImportMessage,
|
|
4145
|
+
name: "src/index"
|
|
4146
|
+
},
|
|
4147
|
+
{
|
|
4148
|
+
importNames: ["default"],
|
|
4149
|
+
message: noPluginImportMessage,
|
|
4150
|
+
name: "src"
|
|
4151
|
+
}
|
|
4152
|
+
]
|
|
4153
|
+
}
|
|
4154
|
+
]
|
|
4155
|
+
}
|
|
4156
|
+
},
|
|
4130
4157
|
{
|
|
4131
4158
|
// Since the object exported in the rules index serves the same function as the exports in other projects, it's best to sort them in alphabetical order
|
|
4132
4159
|
// as well to make it easier to compare against the file directory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/eslint-plugin",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
4
4
|
"description": "A package to provide custom ESLint rules and configs",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "alextheman",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsup",
|
|
14
|
+
"build": "tsup && npx tsx src/utility/hashConfigChanges.ts",
|
|
15
15
|
"change-major": "npm version major -m \"Change version number to v%s\"",
|
|
16
16
|
"change-minor": "npm version minor -m \"Change version number to v%s\"",
|
|
17
17
|
"change-patch": "npm version patch -m \"Change version number to v%s\"",
|
|
18
18
|
"create-local-package": "npm run build && rm -f alextheman-eslint-plugin-*.tgz && npm pack",
|
|
19
|
-
"format": "npm run build && npm run format-prettier && npm run format-eslint",
|
|
19
|
+
"format": "npx tsx src/utility/checkConfigChanges.ts || npm run build && npm run format-prettier && npm run format-eslint",
|
|
20
20
|
"format-eslint": "eslint --fix --suppress-all \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\" && rm -f eslint-suppressions.json",
|
|
21
21
|
"format-prettier": "npm run format-prettier-typescript && npm run format-prettier-javascript",
|
|
22
22
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
23
23
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
24
|
-
"lint": "npm run build && npm run lint-tsc && npm run lint-eslint && npm run lint-prettier",
|
|
24
|
+
"lint": "npx tsx src/utility/checkConfigChanges.ts || npm run build && npm run lint-tsc && npm run lint-eslint && npm run lint-prettier",
|
|
25
25
|
"lint-eslint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\"",
|
|
26
26
|
"lint-prettier": "npm run lint-prettier-typescript && npm run lint-prettier-javascript",
|
|
27
27
|
"lint-prettier-javascript": "prettier --check \"./**/*.js\"",
|