xenopomp-essentials 0.1.3-rc.3 → 0.1.3-rc.5
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/eslint/index.d.mts +34 -0
- package/eslint/index.d.ts +34 -0
- package/eslint/index.mjs +1 -0
- package/package.json +9 -3
- package/eslint/defaults/index.ts +0 -1
- package/eslint/defaults/ririd.ts +0 -33
- package/eslint/index.ts +0 -97
- package/eslint/types/index.ts +0 -1
- package/eslint/types/ririd.ts +0 -8
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { antfu, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
2
|
+
|
|
3
|
+
interface CustomConfig {
|
|
4
|
+
all?: boolean;
|
|
5
|
+
next?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type UserConfigItem = Parameters<typeof antfu>[1];
|
|
9
|
+
type Configs = ReturnType<typeof antfu>;
|
|
10
|
+
|
|
11
|
+
type Options = OptionsConfig & CustomConfig & TypedFlatConfigItem;
|
|
12
|
+
/**
|
|
13
|
+
* XenoPOMP`s default ESLint config. Uses @antfu/eslint-config under the hood.
|
|
14
|
+
*
|
|
15
|
+
* @param options
|
|
16
|
+
* @param userConfigs
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* export default xenopomp(
|
|
20
|
+
* // Setup antfu config
|
|
21
|
+
* {
|
|
22
|
+
* react: true,
|
|
23
|
+
* next: false,
|
|
24
|
+
* },
|
|
25
|
+
* // User configs
|
|
26
|
+
* {
|
|
27
|
+
* name: 'My custom config',
|
|
28
|
+
* rules: { ... }
|
|
29
|
+
* },
|
|
30
|
+
* );
|
|
31
|
+
*/
|
|
32
|
+
declare function xenopomp(options?: Options, ...userConfigs: UserConfigItem[]): Configs;
|
|
33
|
+
|
|
34
|
+
export { type Configs, type CustomConfig, type Options, type UserConfigItem, xenopomp as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { antfu, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
2
|
+
|
|
3
|
+
interface CustomConfig {
|
|
4
|
+
all?: boolean;
|
|
5
|
+
next?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type UserConfigItem = Parameters<typeof antfu>[1];
|
|
9
|
+
type Configs = ReturnType<typeof antfu>;
|
|
10
|
+
|
|
11
|
+
type Options = OptionsConfig & CustomConfig & TypedFlatConfigItem;
|
|
12
|
+
/**
|
|
13
|
+
* XenoPOMP`s default ESLint config. Uses @antfu/eslint-config under the hood.
|
|
14
|
+
*
|
|
15
|
+
* @param options
|
|
16
|
+
* @param userConfigs
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* export default xenopomp(
|
|
20
|
+
* // Setup antfu config
|
|
21
|
+
* {
|
|
22
|
+
* react: true,
|
|
23
|
+
* next: false,
|
|
24
|
+
* },
|
|
25
|
+
* // User configs
|
|
26
|
+
* {
|
|
27
|
+
* name: 'My custom config',
|
|
28
|
+
* rules: { ... }
|
|
29
|
+
* },
|
|
30
|
+
* );
|
|
31
|
+
*/
|
|
32
|
+
declare function xenopomp(options?: Options, ...userConfigs: UserConfigItem[]): Configs;
|
|
33
|
+
|
|
34
|
+
export { type Configs, type CustomConfig, type Options, type UserConfigItem, xenopomp as default };
|
package/eslint/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{GLOB_JSX as a,GLOB_TSX as i,interopDefault as f,GLOB_MARKDOWN_CODE as l,antfu as p}from"@antfu/eslint-config";import{deepmerge as o}from"deepmerge-ts";import r from"globals";import c from"eslint-plugin-prettier/recommended";const u="XenoPOMP",n=u.toLowerCase();async function m(){return[{files:[a,i],name:`${n}:react`,rules:{"react-refresh/only-export-components":"off","react/no-clone-element":"off","react/no-missing-component-display-name":"off"}}]}async function d(){const e=await f(import("@next/eslint-plugin-next"));return[{name:`${n}:next`,plugins:{"@next/next":e},rules:{"@next/next/google-font-display":"warn","@next/next/google-font-preconnect":"warn","@next/next/next-script-for-ga":"warn","@next/next/no-async-client-component":"warn","@next/next/no-before-interactive-script-outside-document":"warn","@next/next/no-css-tags":"warn","@next/next/no-head-element":"warn","@next/next/no-html-link-for-pages":"warn","@next/next/no-img-element":"warn","@next/next/no-page-custom-font":"warn","@next/next/no-styled-jsx-in-document":"warn","@next/next/no-sync-scripts":"warn","@next/next/no-title-in-document-head":"warn","@next/next/no-typos":"warn","@next/next/no-unwanted-polyfillio":"warn","@next/next/inline-script-id":"error","@next/next/no-assign-module-variable":"error","@next/next/no-document-import-in-page":"error","@next/next/no-duplicate-head":"error","@next/next/no-head-import-in-document":"error","@next/next/no-script-component-in-head":"error"}}]}async function x(){return[{name:`${n}:markdown`,files:[l],rules:{"import/no-unresolved":"off","unused-imports/no-unused-imports":"off","unused-imports/no-unused-vars":"off","no-alert":"off","no-console":"off","no-restricted-imports":"off","no-undef":"off","no-unused-expressions":"off","no-unused-vars":"off","antfu/no-cjs-exports":"off","antfu/no-ts-export-equal":"off","ts/no-redeclare":"off","ts/no-unused-vars":"off","ts/no-var-requires":"off","ts/consistent-type-imports":"off"}}]}async function y(){return[{name:`${n}:all`,rules:{"antfu/no-cjs-exports":"off","import/prefer-default-export":"off","import/extensions":"off","no-restricted-globals":"off","node/prefer-global/process":"off","jsonc/comma-dangle":"off","style/jsx-quotes":["error","prefer-double"],"style/jsx-one-expression-per-line":["error",{allow:"single-line"}],"style/arrow-parens":["error","as-needed"],"unused-imports/no-unused-imports":"error","unused-imports/no-unused-vars":["warn",{vars:"all",varsIgnorePattern:"^_",args:"after-used",argsIgnorePattern:"^_"}],"@stylistic/indent":["error",2,{ArrayExpression:1,CallExpression:{arguments:1},flatTernaryExpressions:!1,FunctionDeclaration:{body:1,parameters:1},FunctionExpression:{body:1,parameters:1},ignoreComments:!1,ignoredNodes:["TemplateLiteral *","TSIntersectionType","TSTypeParameterInstantiation","FunctionExpression > .params[decorators.length > 0]","FunctionExpression > .params > :matches(Decorator, :not(:first-child))","ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"],ImportDeclaration:1,MemberExpression:1,ObjectExpression:1,offsetTernaryExpressions:!0,outerIIFEBody:1,SwitchCase:1,VariableDeclarator:1}]}}]}async function g(){return[{name:`${n}:old_config`,languageOptions:{globals:{...r.browser,...r.jquery,...r.node,document:"readonly",navigator:"readonly",window:"readonly"}},ignores:["**/.next/*","**/node_modules/*","**/.github/*","cypress","**/__tests__/e2e/*","*.json","**/*.d.ts",".eslintrc.js","eslint.config.js",".prettierrc",".stylelintrc.js","tsconfig.json","package.json","*.md","*.config.ts","*.config.js","*.md"]},{name:`${n}:rules_breakup_1`,rules:{"@next/next/no-duplicate-head":"off"}},{name:`${n}:rules_breakup_2`,rules:{"style/operator-linebreak":"off","test/consistent-test-it":"off","test/prefer-lowercase-title":"off","style/jsx-quotes":"off","style/multiline-ternary":"off","style/indent":"off"},ignores:["cypress"]},{name:`${n}:prettier`,rules:{"antfu/if-newline":"off"}}]}async function w(){return[c]}function h(e,...s){const t=[];return e={...e,react:o(!0,e?.react),vue:o(!1,e?.vue),jsonc:o(!1,e?.jsonc),yaml:o(!1,e?.yaml),stylistic:o({semi:!0,quotes:"single"},e?.stylistic),typescript:o({overrides:{"ts/consistent-type-definitions":["error","interface"],"ts/interface-name-prefix":"off","ts/explicit-function-return-type":"off","ts/explicit-module-boundary-types":"off","ts/no-explicit-any":"off"}},e?.typescript),rules:o({"import/order":"off","react/react-in-jsx-scope":"off","react/prop-types":"off","antfu/top-level-function":"off","perfectionist/sort-imports":"off","perfectionist/sort-named-imports":"off","perfectionist/sort-named-exports":"off","antfu/consistent-chaining":"off","perfectionist/sort-exports":"off","style/no-multiple-empty-lines":"off"},e?.rules)},(e.react??!0)&&t.push(m()),(e.all??!0)&&t.push(y()),(e.next??!1)&&t.push(d()),(e.markdown??!0)&&t.push(x()),t.push(g()),t.push(w()),p(e,...t,...s)}export{h as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xenopomp-essentials",
|
|
3
|
-
"version": "0.1.3-rc.
|
|
3
|
+
"version": "0.1.3-rc.5",
|
|
4
4
|
"author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@types/react": ">=19",
|
|
31
31
|
"eslint": "^9",
|
|
32
|
+
"eslint-config-prettier": ">=10.1.1",
|
|
33
|
+
"eslint-plugin-prettier": ">=5.2.3",
|
|
32
34
|
"next": ">=15",
|
|
33
35
|
"react": ">=19",
|
|
34
36
|
"type-fest": ">=4",
|
|
@@ -37,11 +39,12 @@
|
|
|
37
39
|
},
|
|
38
40
|
"dependencies": {
|
|
39
41
|
"@antfu/eslint-config": "^4.10.1",
|
|
40
|
-
"@
|
|
42
|
+
"@next/eslint-plugin-next": "^15.2.3",
|
|
41
43
|
"@types/react": "^19.0.8",
|
|
42
44
|
"deepmerge-ts": "^7.1.5",
|
|
43
45
|
"eslint": "^9.22.0",
|
|
44
|
-
"eslint-
|
|
46
|
+
"eslint-config-prettier": "^10.1.1",
|
|
47
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
45
48
|
"globals": "^16.0.0",
|
|
46
49
|
"next": "^15.1.6",
|
|
47
50
|
"react": "^19.0.0",
|
|
@@ -51,11 +54,14 @@
|
|
|
51
54
|
"zod": "^3.24.1"
|
|
52
55
|
},
|
|
53
56
|
"devDependencies": {
|
|
57
|
+
"@eslint-react/eslint-plugin": "^1.36.1",
|
|
54
58
|
"@testing-library/dom": "^10.4.0",
|
|
55
59
|
"@testing-library/react": "^16.2.0",
|
|
56
60
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
57
61
|
"@vitejs/plugin-react": "^4.3.4",
|
|
58
62
|
"@vitest/coverage-istanbul": "^3.0.4",
|
|
63
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
64
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
59
65
|
"esno": "^4.8.0",
|
|
60
66
|
"husky": "^9.1.7",
|
|
61
67
|
"hygen": "^6.2.11",
|
package/eslint/defaults/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ririd';
|
package/eslint/defaults/ririd.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { RiridOptions } from '../types';
|
|
2
|
-
|
|
3
|
-
export const defaultRiridOptions: RiridOptions = {
|
|
4
|
-
next: true,
|
|
5
|
-
react: true,
|
|
6
|
-
jsonc: false,
|
|
7
|
-
yaml: false,
|
|
8
|
-
stylistic: {
|
|
9
|
-
semi: true,
|
|
10
|
-
quotes: 'single',
|
|
11
|
-
},
|
|
12
|
-
typescript: {
|
|
13
|
-
overrides: {
|
|
14
|
-
'ts/consistent-type-definitions': ['error', 'interface'],
|
|
15
|
-
'ts/interface-name-prefix': 'off',
|
|
16
|
-
'ts/explicit-function-return-type': 'off',
|
|
17
|
-
'ts/explicit-module-boundary-types': 'off',
|
|
18
|
-
'ts/no-explicit-any': 'off',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
'import/order': 'off',
|
|
23
|
-
'react/react-in-jsx-scope': 'off',
|
|
24
|
-
'react/prop-types': 'off',
|
|
25
|
-
'antfu/top-level-function': 'off',
|
|
26
|
-
'perfectionist/sort-imports': 'off',
|
|
27
|
-
'perfectionist/sort-named-imports': 'off',
|
|
28
|
-
'perfectionist/sort-named-exports': 'off',
|
|
29
|
-
'antfu/consistent-chaining': 'off',
|
|
30
|
-
'perfectionist/sort-exports': 'off',
|
|
31
|
-
'style/no-multiple-empty-lines': 'off',
|
|
32
|
-
},
|
|
33
|
-
};
|
package/eslint/index.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import ririd from '@ririd/eslint-config';
|
|
2
|
-
import { deepmerge } from 'deepmerge-ts';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
|
|
5
|
-
import { defaultRiridOptions } from './defaults';
|
|
6
|
-
import type { RiridOptions, RiridReturn, UserConfig } from './types';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* XenoPOMP`s default ESLint config. Uses @ririd/eslint-config
|
|
10
|
-
* under the hood.
|
|
11
|
-
*
|
|
12
|
-
* @param options
|
|
13
|
-
* @param userConfigs
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* import { xenopomp } from 'xenopomp-essentials';
|
|
17
|
-
*
|
|
18
|
-
* export default xenopomp(
|
|
19
|
-
* // Setup Ririd options
|
|
20
|
-
* {
|
|
21
|
-
* react: false,
|
|
22
|
-
* },
|
|
23
|
-
*
|
|
24
|
-
* // Setup custom user configs
|
|
25
|
-
* {
|
|
26
|
-
* name: 'Custom config #1',
|
|
27
|
-
* rules: {
|
|
28
|
-
* 'some/rule-name': 'warn',
|
|
29
|
-
* },
|
|
30
|
-
* // ...
|
|
31
|
-
* },
|
|
32
|
-
* // ...
|
|
33
|
-
* );
|
|
34
|
-
*/
|
|
35
|
-
export default function xenopomp(
|
|
36
|
-
options?: RiridOptions,
|
|
37
|
-
...userConfigs: UserConfig[]
|
|
38
|
-
): RiridReturn {
|
|
39
|
-
return ririd(
|
|
40
|
-
deepmerge(defaultRiridOptions, options),
|
|
41
|
-
|
|
42
|
-
// User configs
|
|
43
|
-
{
|
|
44
|
-
name: 'Old config',
|
|
45
|
-
languageOptions: {
|
|
46
|
-
globals: {
|
|
47
|
-
...globals.browser,
|
|
48
|
-
...globals.jquery,
|
|
49
|
-
...globals.node,
|
|
50
|
-
|
|
51
|
-
// Rewrite globals anyway
|
|
52
|
-
document: 'readonly',
|
|
53
|
-
navigator: 'readonly',
|
|
54
|
-
window: 'readonly',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
// Ignore patterns
|
|
59
|
-
ignores: [
|
|
60
|
-
'**/.next/*',
|
|
61
|
-
'**/node_modules/*',
|
|
62
|
-
'**/.github/*',
|
|
63
|
-
'cypress',
|
|
64
|
-
'**/__tests__/e2e/*',
|
|
65
|
-
'*.json',
|
|
66
|
-
'**/*.d.ts',
|
|
67
|
-
'.eslintrc.js',
|
|
68
|
-
'eslint.config.js',
|
|
69
|
-
'.prettierrc',
|
|
70
|
-
'.stylelintrc.js',
|
|
71
|
-
'tsconfig.json',
|
|
72
|
-
'package.json',
|
|
73
|
-
'*.md',
|
|
74
|
-
'*.config.ts',
|
|
75
|
-
'*.config.js',
|
|
76
|
-
'*.md',
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'Rules breakup #1',
|
|
81
|
-
rules: { '@next/next/no-duplicate-head': 'off' },
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'Rules breakup #2',
|
|
85
|
-
rules: {
|
|
86
|
-
'style/operator-linebreak': 'off',
|
|
87
|
-
'test/consistent-test-it': 'off',
|
|
88
|
-
'test/prefer-lowercase-title': 'off',
|
|
89
|
-
'style/jsx-quotes': 'off',
|
|
90
|
-
'style/multiline-ternary': 'off',
|
|
91
|
-
'style/indent': 'off',
|
|
92
|
-
},
|
|
93
|
-
ignores: ['cypress'],
|
|
94
|
-
},
|
|
95
|
-
...userConfigs,
|
|
96
|
-
);
|
|
97
|
-
}
|
package/eslint/types/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ririd';
|
package/eslint/types/ririd.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type ririd from '@ririd/eslint-config';
|
|
2
|
-
|
|
3
|
-
import type { Defined } from '@/types';
|
|
4
|
-
|
|
5
|
-
export type RiridReturn = ReturnType<typeof ririd>;
|
|
6
|
-
export type RiridParams = Parameters<typeof ririd>;
|
|
7
|
-
export type RiridOptions = Defined<RiridParams[0]>;
|
|
8
|
-
export type UserConfig = Defined<RiridParams[1]>;
|