@webikon/webentor-configs 1.0.0

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.
@@ -0,0 +1,11 @@
1
+ {
2
+ "indentSize": 2,
3
+ "wrapAttributes": "force-expand-multiline",
4
+ "wrapLineLength": 999,
5
+ "endWithNewLine": true,
6
+ "noMultipleEmptyLines": false,
7
+ "useTabs": false,
8
+ "sortTailwindcssClasses": true,
9
+ "sortHtmlAttributes": "none",
10
+ "noPhpSyntaxCheck": false
11
+ }
package/.editorconfig ADDED
@@ -0,0 +1,24 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ indent_style = space
8
+ indent_size = 2
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
13
+
14
+ [*.php]
15
+ indent_size = 4
16
+
17
+ [*.blade.php]
18
+ indent_size = 2
19
+
20
+ [resources/views/**.php]
21
+ indent_size = 2
22
+
23
+ [index.php]
24
+ indent_size = 2
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Webentor Configs Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Added shared ESLint, Stylelint, and Prettier presets.
6
+ - Added static references for PHPCS, Blade formatter, and EditorConfig.
7
+ - Added npm export contract for direct import by starter/core projects.
package/LICENCE.md ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) Webikon s.r.o.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @webikon/webentor-configs
2
+
3
+ Shared lint/format presets for Webentor repositories.
4
+
5
+ ## Usage
6
+
7
+ ```js
8
+ // eslint.config.js
9
+ import { createEslintConfig } from '@webikon/webentor-configs/eslint';
10
+ export default createEslintConfig();
11
+ ```
12
+
13
+ ```js
14
+ // .stylelintrc.js
15
+ import { createStylelintConfig } from '@webikon/webentor-configs/stylelint';
16
+ export default createStylelintConfig();
17
+ ```
18
+
19
+ ```js
20
+ // .prettierrc.js
21
+ import { createPrettierConfig } from '@webikon/webentor-configs/prettier';
22
+ export default createPrettierConfig({ tailwindStylesheet: './resources/styles/app.css' });
23
+ ```
24
+
25
+ Static references shipped in this package:
26
+
27
+ - `phpcs.xml`
28
+ - `.bladeformatterrc`
29
+ - `.editorconfig`
@@ -0,0 +1,49 @@
1
+ import pluginJs from '@eslint/js';
2
+ import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
3
+ import pluginReact from 'eslint-plugin-react';
4
+ import globals from 'globals';
5
+ import tseslint from 'typescript-eslint';
6
+
7
+ /**
8
+ * Factory for project-specific ESLint overrides.
9
+ * Keep the base deterministic to avoid lint drift across repositories.
10
+ */
11
+ export function createEslintConfig(overrides = {}) {
12
+ const baseRules = {
13
+ 'react/prop-types': 0,
14
+ 'react/display-name': 0,
15
+ 'prefer-template': 1,
16
+ '@typescript-eslint/no-explicit-any': 'warn',
17
+ '@typescript-eslint/no-unused-vars': 'warn',
18
+ };
19
+
20
+ return [
21
+ { files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
22
+ {
23
+ languageOptions: {
24
+ globals: globals.browser,
25
+ parserOptions: {
26
+ tsconfigRootDir: process.cwd(),
27
+ },
28
+ },
29
+ },
30
+ pluginJs.configs.recommended,
31
+ ...tseslint.configs.recommended,
32
+ pluginReact.configs.flat.recommended,
33
+ pluginReact.configs.flat['jsx-runtime'],
34
+ pluginPrettierRecommended,
35
+ {
36
+ settings: {
37
+ react: {
38
+ version: 'detect',
39
+ },
40
+ },
41
+ rules: {
42
+ ...baseRules,
43
+ ...(overrides.rules || {}),
44
+ },
45
+ },
46
+ ];
47
+ }
48
+
49
+ export default createEslintConfig();
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@webikon/webentor-configs",
3
+ "homepage": "https://webikon.sk",
4
+ "version": "1.0.0",
5
+ "author": "Webikon s.r.o.",
6
+ "description": "Shared lint and formatting presets for Webentor projects.",
7
+ "license": "MIT",
8
+ "maintainers": [
9
+ {
10
+ "name": "Webikon s.r.o.",
11
+ "email": "support@webikon.sk"
12
+ },
13
+ {
14
+ "name": "Pavol Caban",
15
+ "email": "pavol.caban@webikon.sk"
16
+ }
17
+ ],
18
+ "engines": {
19
+ "node": ">=20.0.0"
20
+ },
21
+ "type": "module",
22
+ "exports": {
23
+ "./eslint": "./eslint.config.js",
24
+ "./stylelint": "./stylelint.config.js",
25
+ "./prettier": "./prettier.config.js",
26
+ "./phpcs.xml": "./phpcs.xml",
27
+ "./bladeformatter": "./.bladeformatterrc",
28
+ "./editorconfig": "./.editorconfig"
29
+ },
30
+ "peerDependencies": {
31
+ "@eslint/js": "^9.0.0",
32
+ "eslint": "^9.0.0",
33
+ "eslint-config-prettier": "^10.0.0",
34
+ "eslint-plugin-prettier": "^5.0.0",
35
+ "eslint-plugin-react": "^7.0.0",
36
+ "globals": "^16.0.0",
37
+ "stylelint": "^16.0.0",
38
+ "stylelint-config-recommended": "^17.0.0",
39
+ "typescript-eslint": "^8.0.0"
40
+ },
41
+ "files": [
42
+ "eslint.config.js",
43
+ "stylelint.config.js",
44
+ "prettier.config.js",
45
+ "phpcs.xml",
46
+ ".bladeformatterrc",
47
+ ".editorconfig",
48
+ "README.md",
49
+ "CHANGELOG.md"
50
+ ]
51
+ }
package/phpcs.xml ADDED
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0"?>
2
+ <ruleset name="Webikon">
3
+ <description>Webikon Coding Standards</description>
4
+
5
+ <!-- Scan all files in directory -->
6
+ <file>.</file>
7
+
8
+ <!-- Scan only PHP files -->
9
+ <arg name="extensions" value="php"/>
10
+
11
+ <!-- Ignore WordPress and Composer dependencies -->
12
+ <exclude-pattern>vendor/</exclude-pattern>
13
+
14
+ <!-- Show colors in console -->
15
+ <arg value="-colors"/>
16
+
17
+ <!-- Show sniff codes in all reports -->
18
+ <arg value="ns"/>
19
+
20
+ <!-- Use PSR-2 as a base -->
21
+ <rule ref="PSR2">
22
+ <exclude name="Generic.Files.LineLength"/>
23
+ <exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
24
+ </rule>
25
+ </ruleset>
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Shared Prettier preset. Consumers can pass `tailwindStylesheet` and
3
+ * `importOrder` without duplicating the full default object.
4
+ */
5
+ export function createPrettierConfig(overrides = {}) {
6
+ const baseConfig = {
7
+ plugins: [
8
+ '@shufo/prettier-plugin-blade',
9
+ '@ianvs/prettier-plugin-sort-imports',
10
+ 'prettier-plugin-tailwindcss',
11
+ ],
12
+ semi: true,
13
+ singleQuote: true,
14
+ tabWidth: 2,
15
+ trailingComma: 'all',
16
+ useTabs: false,
17
+ wrapAttributes: 'force-expand-multiline',
18
+ sortTailwindcssClasses: true,
19
+ sortHtmlAttributes: 'none',
20
+ noPhpSyntaxCheck: false,
21
+ overrides: [
22
+ {
23
+ files: ['*.blade.php'],
24
+ options: {
25
+ tabWidth: 2,
26
+ parser: 'blade',
27
+ },
28
+ },
29
+ ],
30
+ importOrder: [
31
+ '^react',
32
+ '<THIRD_PARTY_MODULES>',
33
+ '',
34
+ '^[.]',
35
+ '',
36
+ '<TYPES>^[.]',
37
+ '<TYPES>',
38
+ '',
39
+ '^(?!.*[.]css$)[./].*$',
40
+ '.css$',
41
+ ],
42
+ };
43
+
44
+ // Deep-merge the `overrides` array so consumers can add per-file settings
45
+ // without accidentally wiping the built-in blade.php config.
46
+ const mergedOverrides = [
47
+ ...baseConfig.overrides,
48
+ ...(overrides.overrides || []),
49
+ ];
50
+
51
+ return {
52
+ ...baseConfig,
53
+ ...overrides,
54
+ overrides: mergedOverrides,
55
+ };
56
+ }
57
+
58
+ export default createPrettierConfig();
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Shared Stylelint preset for Tailwind v4 + Webentor blocks.
3
+ */
4
+ export function createStylelintConfig(overrides = {}) {
5
+ const baseConfig = {
6
+ extends: ['stylelint-config-recommended'],
7
+ rules: {
8
+ 'no-descending-specificity': null,
9
+ 'no-invalid-position-at-import-rule': null,
10
+ 'media-query-no-invalid': [
11
+ true,
12
+ {
13
+ ignoreFunctions: ['theme'],
14
+ },
15
+ ],
16
+ 'no-empty-source': null,
17
+ 'property-no-deprecated': null,
18
+ 'import-notation': null,
19
+ 'at-rule-no-unknown': [
20
+ true,
21
+ {
22
+ ignoreAtRules: [
23
+ 'theme',
24
+ 'source',
25
+ 'utility',
26
+ 'variant',
27
+ 'custom-variant',
28
+ 'plugin',
29
+ 'apply',
30
+ 'reference',
31
+ ],
32
+ },
33
+ ],
34
+ 'function-no-unknown': [
35
+ true,
36
+ {
37
+ ignoreFunctions: ['theme'],
38
+ },
39
+ ],
40
+ 'at-rule-no-deprecated': [
41
+ true,
42
+ {
43
+ ignoreAtRules: ['apply'],
44
+ },
45
+ ],
46
+ 'no-invalid-position-declaration': null,
47
+ 'nesting-selector-no-missing-scoping-root': [
48
+ true,
49
+ {
50
+ ignoreAtRules: ['mixin', 'utility'],
51
+ },
52
+ ],
53
+ },
54
+ };
55
+
56
+ return {
57
+ ...baseConfig,
58
+ ...overrides,
59
+ rules: {
60
+ ...baseConfig.rules,
61
+ ...(overrides.rules || {}),
62
+ },
63
+ };
64
+ }
65
+
66
+ export default createStylelintConfig();