@st1ggy/linter-config 1.0.50 → 1.0.52

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/bun.lockb CHANGED
Binary file
package/eslint.config.js CHANGED
@@ -1,9 +1,7 @@
1
1
  import common from './src/eslint/eslint.config.common.js'
2
- import react from './src/eslint/eslint.config.react.js'
3
2
 
4
3
  export default [
5
- // ...common,
6
- ...react,
4
+ ...common,
7
5
  {
8
6
  rules: {
9
7
  'import/extensions': 'off',
package/index.js CHANGED
@@ -1,6 +1,8 @@
1
- import eslintCommon from './src/eslint/eslint.config.common.js'
2
- import eslintReact from './src/eslint/eslint.config.react.js'
3
- import eslintTypescript from './src/eslint/eslint.config.typescript.js'
4
- import prettierCommon from './src/prettier/prettier.config.common.js'
1
+ export { default as eslintCommon } from './src/eslint/eslint.config.common.js'
2
+ export { default as eslintTypescript } from './src/eslint/eslint.config.typescript.js'
3
+ export { default as eslintReact } from './src/eslint/eslint.config.react.js'
5
4
 
6
- export { eslintCommon, prettierCommon, eslintReact, eslintTypescript }
5
+ export { default as prettierCommon } from './src/prettier/prettier.config.common.js'
6
+
7
+ export { default as stylelintCommon } from './src/stylelint/stylelint.config.common.js'
8
+ export { default as stylelintScss } from './src/stylelint/stylelint.config.scss.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@st1ggy/linter-config",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -29,10 +29,14 @@
29
29
  "eslint-plugin-prettier": "5.1.3",
30
30
  "eslint-plugin-react": "7.34.1",
31
31
  "eslint-plugin-react-hooks": "5.1.0-canary-fd0da3eef-20240404",
32
- "eslint-plugin-sonarjs": "^1.0.3",
32
+ "eslint-plugin-sonarjs": "1.0.3",
33
33
  "eslint-plugin-unicorn": "52.0.0",
34
34
  "gently-copy": "3.2.0",
35
35
  "prettier": "3.2.5",
36
+ "stylelint": "16.5.0",
37
+ "stylelint-config-recommended": "^14.0.0",
38
+ "stylelint-config-sass-guidelines": "11.1.0",
39
+ "stylelint-config-tailwindcss": "0.0.7",
36
40
  "typescript": "5.4.5",
37
41
  "typescript-eslint": "7.8.0"
38
42
  },
@@ -1,58 +1,4 @@
1
- import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
2
- import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'
3
- import reactHooksPlugin from 'eslint-plugin-react-hooks'
4
-
1
+ import reactRules from './rules/rules.react.js'
5
2
  import typescript from './eslint.config.typescript.js'
6
3
 
7
- export default [
8
- ...typescript,
9
- reactRecommended,
10
- reactJsxRuntime,
11
- // reactHooksPlugin.configs.recommended,
12
- {
13
- plugins: { 'react-hooks': reactHooksPlugin },
14
- rules: {
15
- 'react/boolean-prop-naming': 'error',
16
- 'react/button-has-type': 'error',
17
- 'react/checked-requires-onchange-or-readonly': 'error',
18
- 'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
19
- 'react/destructuring-assignment': 'error',
20
- 'react/function-component-definition': [
21
- 'error',
22
- {
23
- namedComponents: 'arrow-function',
24
- unnamedComponents: 'arrow-function',
25
- },
26
- ],
27
- 'react/hook-use-state': 'error',
28
- 'react/jsx-boolean-value': 'error',
29
- 'react/jsx-child-element-spacing': 'error',
30
- 'react/jsx-closing-bracket-location': 'error',
31
- 'react/jsx-closing-tag-location': 'error',
32
- 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
33
- 'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
34
- 'react/jsx-curly-spacing': [
35
- 'error',
36
- {
37
- when: 'never',
38
- attributes: { allowMultiline: false },
39
- children: false,
40
- },
41
- ],
42
- 'react/jsx-equals-spacing': ['error', 'never'],
43
- 'react/jsx-first-prop-new-line': ['error', 'multiline'],
44
- 'react/jsx-fragments': 'error',
45
- 'react/jsx-handler-names': 'error',
46
- 'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
47
- 'react/jsx-no-constructed-context-values': 'error',
48
- 'react/jsx-no-leaked-render': 'error',
49
- 'react/jsx-no-useless-fragment': 'error',
50
- 'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
51
- 'react/jsx-props-no-multi-spaces': 'error',
52
- 'react/jsx-tag-spacing': 'error',
53
- 'react/no-multi-comp': 'error',
54
- 'react/self-closing-comp': ['error', { component: true, html: true }],
55
- ...reactHooksPlugin.configs.recommended.rules,
56
- },
57
- },
58
- ]
4
+ export default [...typescript, ...reactRules]
@@ -1,29 +1,11 @@
1
1
  import tseslint from 'typescript-eslint'
2
2
 
3
+ import typescriptRules from './rules/rules.typescript.js'
3
4
  import common from './eslint.config.common.js'
4
5
 
5
- export default tseslint.config(...tseslint.configs.recommended, ...tseslint.configs.stylistic, ...common, {
6
- languageOptions: {
7
- parserOptions: {
8
- project: ['tsconfig.json'],
9
- },
10
- },
11
- settings: {
12
- 'import/resolver': {
13
- typescript: {},
14
- },
15
- },
16
- rules: {
17
- '@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
18
- '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
19
- '@typescript-eslint/ban-ts-comment': [
20
- 'error',
21
- {
22
- 'ts-expect-error': 'allow-with-description',
23
- 'ts-ignore': 'allow-with-description',
24
- },
25
- ],
26
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
27
- '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
28
- },
29
- })
6
+ export default tseslint.config(
7
+ ...common,
8
+ ...tseslint.configs.recommended,
9
+ ...tseslint.configs.stylistic,
10
+ ...typescriptRules,
11
+ )
@@ -0,0 +1,53 @@
1
+ import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
2
+ import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'
3
+
4
+ export default [
5
+ reactRecommended,
6
+ reactJsxRuntime,
7
+ {
8
+ plugins: { 'react-hooks': reactHooksPlugin },
9
+ rules: {
10
+ 'react/boolean-prop-naming': 'error',
11
+ 'react/button-has-type': 'error',
12
+ 'react/checked-requires-onchange-or-readonly': 'error',
13
+ 'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
14
+ 'react/destructuring-assignment': 'error',
15
+ 'react/function-component-definition': [
16
+ 'error',
17
+ {
18
+ namedComponents: 'arrow-function',
19
+ unnamedComponents: 'arrow-function',
20
+ },
21
+ ],
22
+ 'react/hook-use-state': 'error',
23
+ 'react/jsx-boolean-value': 'error',
24
+ 'react/jsx-child-element-spacing': 'error',
25
+ 'react/jsx-closing-bracket-location': 'error',
26
+ 'react/jsx-closing-tag-location': 'error',
27
+ 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
28
+ 'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
29
+ 'react/jsx-curly-spacing': [
30
+ 'error',
31
+ {
32
+ when: 'never',
33
+ attributes: { allowMultiline: false },
34
+ children: false,
35
+ },
36
+ ],
37
+ 'react/jsx-equals-spacing': ['error', 'never'],
38
+ 'react/jsx-first-prop-new-line': ['error', 'multiline'],
39
+ 'react/jsx-fragments': 'error',
40
+ 'react/jsx-handler-names': 'error',
41
+ 'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
42
+ 'react/jsx-no-constructed-context-values': 'error',
43
+ 'react/jsx-no-leaked-render': 'error',
44
+ 'react/jsx-no-useless-fragment': 'error',
45
+ 'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
46
+ 'react/jsx-props-no-multi-spaces': 'error',
47
+ 'react/jsx-tag-spacing': 'error',
48
+ 'react/no-multi-comp': 'error',
49
+ 'react/self-closing-comp': ['error', { component: true, html: true }],
50
+ ...reactHooksPlugin.configs.recommended.rules,
51
+ },
52
+ },
53
+ ]
@@ -0,0 +1,27 @@
1
+ export default [
2
+ {
3
+ languageOptions: {
4
+ parserOptions: {
5
+ project: ['tsconfig.json'],
6
+ },
7
+ },
8
+ settings: {
9
+ 'import/resolver': {
10
+ typescript: {},
11
+ },
12
+ },
13
+ rules: {
14
+ '@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
15
+ '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
16
+ '@typescript-eslint/ban-ts-comment': [
17
+ 'error',
18
+ {
19
+ 'ts-expect-error': 'allow-with-description',
20
+ 'ts-ignore': 'allow-with-description',
21
+ },
22
+ ],
23
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
24
+ '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
25
+ },
26
+ },
27
+ ]
@@ -0,0 +1,3 @@
1
+ export default {
2
+ extends: ['stylelint-config-recommended', 'stylelint-config-tailwindcss'],
3
+ }
@@ -0,0 +1,3 @@
1
+ export default {
2
+ extends: ['stylelint-config-recommended', 'stylelint-config-sass-guidelines', 'stylelint-config-tailwindcss/scss'],
3
+ }
@@ -1,3 +0,0 @@
1
- import { eslintReact } from '@st1ggy/linter-config'
2
-
3
- export default [...eslintReact]
@@ -1,3 +0,0 @@
1
- import { prettierCommon } from '@st1ggy/linter-config'
2
-
3
- export default { ...prettierCommon }
File without changes