@fullstacksjs/eslint-config 11.6.0 → 11.7.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.
package/cjs/index.js CHANGED
@@ -18,6 +18,7 @@ var _playwright = _interopRequireDefault(require("./modules/playwright.js"));
18
18
  var _prettier = _interopRequireDefault(require("./modules/prettier.js"));
19
19
  var _react = _interopRequireDefault(require("./modules/react.js"));
20
20
  var _storybook = _interopRequireDefault(require("./modules/storybook.js"));
21
+ var _stylistic = _interopRequireDefault(require("./modules/stylistic.js"));
21
22
  var _tailwind = _interopRequireDefault(require("./modules/tailwind.js"));
22
23
  var _tests = _interopRequireDefault(require("./modules/tests.js"));
23
24
  var _typescript = _interopRequireDefault(require("./modules/typescript.js"));
@@ -92,7 +93,7 @@ function init(initOptions = {}, ...extend) {
92
93
  vitest: enableVitest,
93
94
  ...eslintOptions
94
95
  } = options;
95
- const rules = [(0, _ignore.default)(options), (0, _base.default)(options)];
96
+ const rules = [(0, _ignore.default)(options), (0, _base.default)(options), (0, _stylistic.default)(options)];
96
97
  if (enableSort) rules.push((0, _perfectionist.default)(options));
97
98
  if (enableImport) rules.push((0, _imports.default)(options));
98
99
  if (enableTailwind) rules.push((0, _tailwind.default)(options));
@@ -76,7 +76,8 @@ function react() {
76
76
  '@eslint-react/hooks-extra/no-useless-custom-hooks': 'warn',
77
77
  '@eslint-react/naming-convention/component-name': 'warn',
78
78
  '@eslint-react/naming-convention/filename': 'off',
79
- '@eslint-react/naming-convention/filename-extension': ['warn', {
79
+ '@eslint-react/naming-convention/filename-extension': ['error', {
80
+ allow: 'always',
80
81
  extensions: ['.jsx', '.tsx']
81
82
  }],
82
83
  '@eslint-react/naming-convention/use-state': 'off',
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _eslintPlugin = _interopRequireDefault(require("@stylistic/eslint-plugin"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /**
10
+ * @param { import('../option').Options } options
11
+ * @return { Promise<import('eslint').Linter.Config> }
12
+ */
13
+ function stylistic() {
14
+ return {
15
+ plugins: {
16
+ '@stylistic': _eslintPlugin.default
17
+ },
18
+ rules: {
19
+ '@stylistic/jsx/jsx-curly-brace-presence': ['warn', {
20
+ props: 'never',
21
+ children: 'never',
22
+ propElementValues: 'always'
23
+ }]
24
+ }
25
+ };
26
+ }
27
+ module.exports = stylistic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "11.6.0",
3
+ "version": "11.7.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -36,6 +36,7 @@
36
36
  "dependencies": {
37
37
  "@eslint-react/eslint-plugin": "1.28.0",
38
38
  "@next/eslint-plugin-next": "15.1.7",
39
+ "@stylistic/eslint-plugin": "4.1.0",
39
40
  "deepmerge": "4.3.1",
40
41
  "eslint-import-resolver-typescript": "3.8.3",
41
42
  "eslint-plugin-cypress": "4.1.0",
package/src/index.mjs CHANGED
@@ -13,6 +13,7 @@ import playwright from './modules/playwright.mjs';
13
13
  import prettier from './modules/prettier.mjs';
14
14
  import react from './modules/react.mjs';
15
15
  import storybook from './modules/storybook.mjs';
16
+ import stylistic from './modules/stylistic.mjs';
16
17
  import tailwind from './modules/tailwind.mjs';
17
18
  import tests from './modules/tests.mjs';
18
19
  import typescript from './modules/typescript.mjs';
@@ -88,7 +89,7 @@ export function init(initOptions = {}, ...extend) {
88
89
  ...eslintOptions
89
90
  } = options;
90
91
 
91
- const rules = [ignores(options), base(options)];
92
+ const rules = [ignores(options), base(options), stylistic(options)];
92
93
 
93
94
  if (enableSort) rules.push(perfectionist(options));
94
95
  if (enableImport) rules.push(imports(options));
@@ -73,7 +73,7 @@ function react() {
73
73
 
74
74
  '@eslint-react/naming-convention/component-name': 'warn',
75
75
  '@eslint-react/naming-convention/filename': 'off',
76
- '@eslint-react/naming-convention/filename-extension': ['warn', { extensions: ['.jsx', '.tsx'] }],
76
+ '@eslint-react/naming-convention/filename-extension': ['error', { allow: 'always', extensions: ['.jsx', '.tsx'] }],
77
77
  '@eslint-react/naming-convention/use-state': 'off',
78
78
 
79
79
  'react-hooks/exhaustive-deps': 'warn',
@@ -0,0 +1,16 @@
1
+ import stylisticPlugin from '@stylistic/eslint-plugin';
2
+
3
+ /**
4
+ * @param { import('../option').Options } options
5
+ * @return { Promise<import('eslint').Linter.Config> }
6
+ */
7
+ function stylistic() {
8
+ return {
9
+ plugins: { '@stylistic': stylisticPlugin },
10
+ rules: {
11
+ '@stylistic/jsx/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never', propElementValues: 'always' }],
12
+ },
13
+ };
14
+ }
15
+
16
+ export default stylistic;