@haltcase/style 7.0.0-canary.12 → 7.0.0-canary.13
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/types/eslint/configs/browser.d.ts +8 -0
- package/dist/types/eslint/configs/cjs.d.ts +4 -0
- package/dist/types/eslint/configs/internal/base.d.ts +52 -0
- package/dist/types/eslint/configs/internal/commonjs.d.ts +4 -0
- package/dist/types/eslint/configs/internal/es2015.d.ts +4 -0
- package/dist/types/eslint/configs/internal/simple-import-sort.d.ts +4 -0
- package/dist/types/eslint/configs/internal/tsdoc.d.ts +4 -0
- package/dist/types/eslint/configs/internal/unicorn.d.ts +4 -0
- package/dist/types/eslint/configs/next.d.ts +8 -0
- package/dist/types/eslint/configs/node.d.ts +8 -0
- package/dist/types/eslint/configs/playwright-test.d.ts +4 -0
- package/dist/types/eslint/configs/react.d.ts +8 -0
- package/dist/types/eslint/configs/typescript.d.ts +4 -0
- package/dist/types/eslint/constants.d.ts +14 -0
- package/dist/types/eslint/index.d.ts +12 -0
- package/dist/types/eslint/rules/best-practice.d.ts +5 -0
- package/dist/types/eslint/rules/imports.d.ts +5 -0
- package/dist/types/eslint/rules/jsx-a11y.d.ts +5 -0
- package/dist/types/eslint/rules/playwright-test.d.ts +8 -0
- package/dist/types/eslint/rules/possible-errors.d.ts +8 -0
- package/dist/types/eslint/rules/react-x.d.ts +8 -0
- package/dist/types/eslint/rules/react.d.ts +11 -0
- package/dist/types/eslint/rules/stylistic-jsx.d.ts +8 -0
- package/dist/types/eslint/rules/stylistic.d.ts +8 -0
- package/dist/types/eslint/rules/typescript/extension.d.ts +5 -0
- package/dist/types/eslint/rules/typescript/import.d.ts +5 -0
- package/dist/types/eslint/rules/typescript/index.d.ts +8 -0
- package/dist/types/eslint/rules/typescript/naming-convention.d.ts +5 -0
- package/dist/types/eslint/rules/variables.d.ts +8 -0
- package/dist/types/eslint/withFiles.d.ts +2 -0
- package/dist/types/prettier/index.d.ts +12 -0
- package/dist/types/stylelint/_base.d.ts +1 -0
- package/dist/types/stylelint/index.d.ts +2 -0
- package/dist/types/stylelint/modules.d.ts +2 -0
- package/dist/types/stylelint/standard.d.ts +1 -0
- package/package.json +31 -8
- package/prettier/index.js +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
3
|
+
*/
|
|
4
|
+
export const getEslintBrowserConfig: import("./internal/base.js").HaltcaseStyleCreator;
|
|
5
|
+
/**
|
|
6
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
7
|
+
*/
|
|
8
|
+
export const getEslintBrowserConfigInternal: import("./internal/base.js").HaltcaseStyleCreator;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} HaltcaseStyleOptions
|
|
3
|
+
* @property {boolean} [browser] Whether to include browser rules and globals.
|
|
4
|
+
* @property {boolean} [commonjs] Whether to treat *.js files as CommonJS instead of ES Modules.
|
|
5
|
+
* @property {boolean} [nextjs] Whether to include Next.js rules (implies `react`).
|
|
6
|
+
* @property {boolean} [node] Whether to include Node.js rules.
|
|
7
|
+
* @property {boolean} [react] Whether to include React rules.
|
|
8
|
+
* @property {ParserOptions["project"]} [typescriptProject = true] Custom TypeScript project options for the `typescript-eslint` parser.
|
|
9
|
+
* // use when VS Code supports `projectService`
|
|
10
|
+
* // https://github.com/microsoft/vscode-eslint/issues/1911
|
|
11
|
+
* property {ProjectServiceOptions} [typescriptProjectServiceOptions = true] Custom TypeScript project service options for the `typescript-eslint` parser.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {(options?: HaltcaseStyleOptions) => Awaited<import("typescript-eslint").Config>} HaltcaseStyleCreator
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Get the common ESLint config for Node and browsers.
|
|
18
|
+
*
|
|
19
|
+
* @type {HaltcaseStyleCreator}
|
|
20
|
+
*/
|
|
21
|
+
export const getEslintBaseConfig: HaltcaseStyleCreator;
|
|
22
|
+
export type HaltcaseStyleOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* Whether to include browser rules and globals.
|
|
25
|
+
*/
|
|
26
|
+
browser?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to treat *.js files as CommonJS instead of ES Modules.
|
|
29
|
+
*/
|
|
30
|
+
commonjs?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to include Next.js rules (implies `react`).
|
|
33
|
+
*/
|
|
34
|
+
nextjs?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to include Node.js rules.
|
|
37
|
+
*/
|
|
38
|
+
node?: boolean | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to include React rules.
|
|
41
|
+
*/
|
|
42
|
+
react?: boolean | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Custom TypeScript project options for the `typescript-eslint` parser.
|
|
45
|
+
* // use when VS Code supports `projectService`
|
|
46
|
+
* // https://github.com/microsoft/vscode-eslint/issues/1911
|
|
47
|
+
* property {ProjectServiceOptions} [typescriptProjectServiceOptions = true] Custom TypeScript project service options for the `typescript-eslint` parser.
|
|
48
|
+
*/
|
|
49
|
+
typescriptProject?: ParserOptions["project"];
|
|
50
|
+
};
|
|
51
|
+
export type HaltcaseStyleCreator = (options?: HaltcaseStyleOptions) => Awaited<import("typescript-eslint").Config>;
|
|
52
|
+
import type { ParserOptions } from "@typescript-eslint/types";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
3
|
+
*/
|
|
4
|
+
export const getEslintNextConfig: import("./internal/base.js").HaltcaseStyleCreator;
|
|
5
|
+
/**
|
|
6
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
7
|
+
*/
|
|
8
|
+
export const getEslintNextConfigInternal: import("./internal/base.js").HaltcaseStyleCreator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
3
|
+
*/
|
|
4
|
+
export const getEslintNodeConfig: import("./internal/base.js").HaltcaseStyleCreator;
|
|
5
|
+
/**
|
|
6
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
7
|
+
*/
|
|
8
|
+
export const getEslintNodeConfigInternal: import("./internal/base.js").HaltcaseStyleCreator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
3
|
+
*/
|
|
4
|
+
export const getEslintReactConfig: import("./internal/base.js").HaltcaseStyleCreator;
|
|
5
|
+
/**
|
|
6
|
+
* @type {import("./internal/base.js").HaltcaseStyleCreator}
|
|
7
|
+
*/
|
|
8
|
+
export const getEslintReactConfigInternal: import("./internal/base.js").HaltcaseStyleCreator;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const ecmaVersion: 2021;
|
|
2
|
+
export const commonJsOnlyFiles: string[];
|
|
3
|
+
export const commonJsFiles: string[];
|
|
4
|
+
export const javascriptFiles: string[];
|
|
5
|
+
export const typescriptFiles: string[];
|
|
6
|
+
export const javascriptJsxFiles: string[];
|
|
7
|
+
export const typescriptJsxFiles: string[];
|
|
8
|
+
export const jsxFiles: string[];
|
|
9
|
+
export const configFiles: string[];
|
|
10
|
+
export const scriptFiles: string[];
|
|
11
|
+
export const nextJsPageFiles: string[];
|
|
12
|
+
export const nextJsApiRoutes: string[];
|
|
13
|
+
export const nextJsMetadataFiles: string[];
|
|
14
|
+
export const allSupportedFiles: string[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import("./configs/internal/base.js").HaltcaseStyleCreator}
|
|
3
|
+
*/
|
|
4
|
+
export const getEslintConfig: import("./configs/internal/base.js").HaltcaseStyleCreator;
|
|
5
|
+
export default getEslintConfig;
|
|
6
|
+
export { getEslintBrowserConfig } from "./configs/browser.js";
|
|
7
|
+
export { getEslintCommonJsConfig } from "./configs/cjs.js";
|
|
8
|
+
export { getEslintNextConfig } from "./configs/next.js";
|
|
9
|
+
export { getEslintNodeConfig } from "./configs/node.js";
|
|
10
|
+
export { getEslintReactConfig } from "./configs/react.js";
|
|
11
|
+
export { getEslintTypescriptConfig } from "./configs/typescript.js";
|
|
12
|
+
export { withFiles } from "./withFiles.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import { Linter } from "eslint"
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* We primarily use `@eslint-react/eslint-plugin`, but it's not quite complete
|
|
6
|
+
* compared to the official plugin. We enable missing rules selectively here.
|
|
7
|
+
*
|
|
8
|
+
* @type {Linter.RulesRecord}
|
|
9
|
+
*/
|
|
10
|
+
export const reactRules: Linter.RulesRecord;
|
|
11
|
+
import type { Linter } from "eslint";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let singleQuote: boolean;
|
|
3
|
+
let trailingComma: string;
|
|
4
|
+
let plugins: string[];
|
|
5
|
+
let tailwindAttributes: string[];
|
|
6
|
+
let tailwindFunctions: string[];
|
|
7
|
+
let endOfLine: "lf";
|
|
8
|
+
let printWidth: number;
|
|
9
|
+
let tabWidth: number;
|
|
10
|
+
let useTabs: true;
|
|
11
|
+
}
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const stylelintBase: import("stylelint-define-config").StylelintConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { stylelintBase as default } from "./_base.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haltcase/style",
|
|
3
|
-
"version": "7.0.0-canary.
|
|
3
|
+
"version": "7.0.0-canary.13",
|
|
4
4
|
"description": "haltcase's web ecosystem style guide & configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -19,13 +19,34 @@
|
|
|
19
19
|
"author": "Bo Lingen <bo@haltcase.dev> (https://haltcase.dev)",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"exports": {
|
|
22
|
-
"./eslint":
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"./
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
"./eslint": {
|
|
23
|
+
"types": "./dist/types/eslint/index.d.ts",
|
|
24
|
+
"default": "./eslint/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./eslint/rules/*": {
|
|
27
|
+
"types": "./dist/types/eslint/rules/*.d.ts",
|
|
28
|
+
"default": "./eslint/rules/*.js"
|
|
29
|
+
},
|
|
30
|
+
"./eslint/rules/typescript": {
|
|
31
|
+
"types": "./dist/types/eslint/rules/typescript/index.d.ts",
|
|
32
|
+
"default": "./eslint/rules/typescript/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./prettier": {
|
|
35
|
+
"types": "./dist/types/prettier/index.d.ts",
|
|
36
|
+
"default": "./prettier/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./stylelint": {
|
|
39
|
+
"types": "./dist/types/stylelint/index.d.ts",
|
|
40
|
+
"default": "./stylelint/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./stylelint/modules": {
|
|
43
|
+
"types": "./dist/types/stylelint/modules.d.ts",
|
|
44
|
+
"default": "./stylelint/modules.js"
|
|
45
|
+
},
|
|
46
|
+
"./stylelint/standard": {
|
|
47
|
+
"types": "./dist/types/stylelint/standard.d.ts",
|
|
48
|
+
"default": "./stylelint/standard.js"
|
|
49
|
+
},
|
|
29
50
|
"./typescript/base": "./typescript/tsconfig.base.json",
|
|
30
51
|
"./typescript/bundler": "./typescript/tsconfig.bundler.json",
|
|
31
52
|
"./typescript/next": "./typescript/tsconfig.next.json",
|
|
@@ -36,6 +57,7 @@
|
|
|
36
57
|
"./typescript/web": "./typescript/tsconfig.web.json"
|
|
37
58
|
},
|
|
38
59
|
"files": [
|
|
60
|
+
"dist",
|
|
39
61
|
"eslint",
|
|
40
62
|
"prettier",
|
|
41
63
|
"stylelint",
|
|
@@ -46,6 +68,7 @@
|
|
|
46
68
|
"eslint-check": "eslint --max-warnings=0 .",
|
|
47
69
|
"format": "eslint --fix . && prettier --write .",
|
|
48
70
|
"prepare": "husky",
|
|
71
|
+
"prepublishOnly": "tsc",
|
|
49
72
|
"prettier-check": "prettier --check .",
|
|
50
73
|
"semantic-release": "semantic-release",
|
|
51
74
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/prettier/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
*
|
|
9
9
|
* See: https://prettier.io/docs/en/configuration#editorconfig
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @satisfies {import("prettier").Options}
|
|
12
12
|
*/
|
|
13
13
|
const overridableDefaults = {
|
|
14
14
|
endOfLine: "lf",
|
|
@@ -24,7 +24,7 @@ const resolvePlugin = (specifier) =>
|
|
|
24
24
|
fileURLToPath(import.meta.resolve(specifier));
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* @
|
|
27
|
+
* @satisfies {import("prettier").Options}
|
|
28
28
|
*/
|
|
29
29
|
export default {
|
|
30
30
|
...overridableDefaults,
|