@coko/lint 3.0.0-alpha.23 → 3.0.0-alpha.25

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.0.0-alpha.25](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.24...v3.0.0-alpha.25) (2026-04-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * **eslint:** add root config with cypress plugin ([6078f5b](https://gitlab.coko.foundation/cokoapps/lint/commit/6078f5bf6e451903738a8eda6f288b7f52ee3877))
11
+ * **eslint:** enable the eslint plugin promises config ([00a6f56](https://gitlab.coko.foundation/cokoapps/lint/commit/00a6f5644eb4f4c371577abdcf4e869383faae0d))
12
+ * **stylelint:** modern stylelint configuration ([9741171](https://gitlab.coko.foundation/cokoapps/lint/commit/974117104009e9b3a254b9539d8082198d68553c))
13
+
14
+ ## [3.0.0-alpha.24](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.23...v3.0.0-alpha.24) (2026-02-04)
15
+
16
+
17
+ ### Features
18
+
19
+ * **eslint:** add process to client globals ([4e12d2d](https://gitlab.coko.foundation/cokoapps/lint/commit/4e12d2d3c892636297516e6ca6c8afa24076d276))
20
+
5
21
  ## [3.0.0-alpha.23](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.22...v3.0.0-alpha.23) (2026-02-03)
6
22
 
7
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coko/lint",
3
- "version": "3.0.0-alpha.23",
3
+ "version": "3.0.0-alpha.25",
4
4
  "description": "Linter configurations and dependencies for coko's projects",
5
5
  "keywords": [
6
6
  "lint",
@@ -14,7 +14,7 @@
14
14
  "license": "MIT",
15
15
  "author": "Yannis Barlas",
16
16
  "engines": {
17
- "node": "^22.16.0"
17
+ "node": ">= 22"
18
18
  },
19
19
  "main": "src/index.mjs",
20
20
  "bin": {
@@ -35,26 +35,18 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@babel/core": "^7.28.6",
39
- "@babel/eslint-parser": "^7.28.6",
40
- "@babel/preset-react": "^7.28.5",
41
- "@commitlint/cli": "^20.3.1",
42
- "@commitlint/config-conventional": "^20.3.1",
43
38
  "@eslint/js": "^9.39.2",
44
39
  "@vitest/eslint-plugin": "^1.6.6",
45
40
  "chalk": "^5.6.2",
46
41
  "commander": "^14.0.2",
47
42
  "commitizen": "^4.3.1",
48
43
  "confusing-browser-globals": "^1.0.11",
49
- "conventional-commit-types": "^3.0.0",
50
- "cz-conventional-changelog": "^3.3.0",
51
44
  "cz-customizable": "^7.5.1",
52
45
  "eslint": "^9.39.2",
53
46
  "eslint-config-prettier": "^10.1.8",
54
47
  "eslint-import-resolver-typescript": "^4.4.4",
55
48
  "eslint-plugin-cypress": "^5.2.1",
56
49
  "eslint-plugin-import": "^2.32.0",
57
- "eslint-plugin-jest": "^29.12.1",
58
50
  "eslint-plugin-jsx-a11y": "^6.10.2",
59
51
  "eslint-plugin-n": "^17.23.2",
60
52
  "eslint-plugin-promise": "^7.2.1",
@@ -62,21 +54,18 @@
62
54
  "eslint-plugin-react-hooks": "^7.0.1",
63
55
  "eslint-plugin-workspaces": "^0.11.1",
64
56
  "globals": "^17.0.0",
65
- "husky": "^9.1.7",
66
57
  "lint-staged": "^16.2.7",
67
58
  "postcss": "^8.5.6",
68
- "postcss-scss": "^4.0.9",
59
+ "postcss-styled-syntax": "^0.7.1",
69
60
  "prettier": "^3.8.0",
70
- "stylelint": "^17.0.0",
71
- "stylelint-config-standard-scss": "^17.0.0",
72
- "stylelint-config-styled-components": "^0.1.1",
73
- "stylelint-order": "^7.0.1",
74
- "stylelint-processor-styled-components": "^1.10.0",
61
+ "stylelint": "^17.1.1",
62
+ "stylelint-config-standard": "^40.0.0",
75
63
  "typescript": "^5.9.3",
76
64
  "typescript-eslint": "^8.53.0"
77
65
  },
78
66
  "devDependencies": {
79
- "standard-version": "^9.5.0"
67
+ "standard-version": "^9.5.0",
68
+ "styled-components": "^6.3.8"
80
69
  },
81
70
  "publishConfig": {
82
71
  "access": "public"
package/src/cli.mjs CHANGED
@@ -61,7 +61,7 @@ const runESLint = isSubprocess => {
61
61
  }
62
62
 
63
63
  const runStylelint = isSubprocess => {
64
- const command = `npx stylelint "${process.cwd()}/**/*.js"`
64
+ const command = `npx stylelint "${process.cwd()}/**/*.{js,jsx,ts,tsx,css}"`
65
65
  runCommand(STYLELINT, command, isSubprocess)
66
66
  }
67
67
 
package/src/commitizen.js CHANGED
@@ -1,6 +1,54 @@
1
- const conventionalCommitTypes = require('conventional-commit-types')
1
+ // https://github.com/commitizen/conventional-commit-types/blob/master/index.json
2
+ const types = {
3
+ feat: {
4
+ description: 'A new feature',
5
+ title: 'Features',
6
+ },
7
+ fix: {
8
+ description: 'A bug fix',
9
+ title: 'Bug Fixes',
10
+ },
11
+ docs: {
12
+ description: 'Documentation only changes',
13
+ title: 'Documentation',
14
+ },
15
+ style: {
16
+ description:
17
+ 'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
18
+ title: 'Styles',
19
+ },
20
+ refactor: {
21
+ description: 'A code change that neither fixes a bug nor adds a feature',
22
+ title: 'Code Refactoring',
23
+ },
24
+ perf: {
25
+ description: 'A code change that improves performance',
26
+ title: 'Performance Improvements',
27
+ },
28
+ test: {
29
+ description: 'Adding missing tests or correcting existing tests',
30
+ title: 'Tests',
31
+ },
32
+ build: {
33
+ description:
34
+ 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
35
+ title: 'Builds',
36
+ },
37
+ ci: {
38
+ description:
39
+ 'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
40
+ title: 'Continuous Integrations',
41
+ },
42
+ chore: {
43
+ description: "Other changes that don't modify src or test files",
44
+ title: 'Chores',
45
+ },
46
+ revert: {
47
+ description: 'Reverts a previous commit',
48
+ title: 'Reverts',
49
+ },
50
+ }
2
51
 
3
- const { types } = conventionalCommitTypes
4
52
  const maxLength = Math.max(Object.keys(types).map(key => key.length)) + 1
5
53
 
6
54
  const choices = Object.keys(types).map(key => {
package/src/eslint.bak.js CHANGED
@@ -1,106 +1,106 @@
1
- module.exports = {
2
- parser: '@babel/eslint-parser',
3
- parserOptions: {
4
- requireConfigFile: false,
5
- babelOptions: {
6
- presets: ['@babel/preset-react'],
7
- },
8
- },
9
- overrides: [
10
- {
11
- files: ['*.jsx'],
12
- },
13
- ],
14
- env: {
15
- browser: true,
16
- es6: true,
17
- jest: true,
18
- node: true,
19
- },
20
- extends: [
21
- 'airbnb',
22
- 'standard',
23
- 'standard-react',
24
- 'plugin:jest/recommended',
25
- 'plugin:cypress/recommended',
26
- 'prettier',
27
- ],
28
- plugins: ['jest'],
29
- ignorePatterns: [
30
- '_build',
31
- 'dist',
32
- '!.storybook',
33
- '!.commitlintrc.js',
34
- '!.cz-config.js',
35
- '!.eslintrc.js',
36
- '!.jest.config.js',
37
- '!.lintstagedrc.js',
38
- '!.prettierrc.js',
39
- '!.stylelintrc.js',
40
- '**/node_modules',
41
- ],
42
- rules: {
43
- 'arrow-body-style': 0,
44
- 'import/no-extraneous-dependencies': [
45
- 'error',
46
- {
47
- devDependencies: [
48
- // storybook
49
- '.storybook/*',
50
- '**/stories/**/*.js',
1
+ // module.exports = {
2
+ // parser: '@babel/eslint-parser',
3
+ // parserOptions: {
4
+ // requireConfigFile: false,
5
+ // babelOptions: {
6
+ // presets: ['@babel/preset-react'],
7
+ // },
8
+ // },
9
+ // overrides: [
10
+ // {
11
+ // files: ['*.jsx'],
12
+ // },
13
+ // ],
14
+ // env: {
15
+ // browser: true,
16
+ // es6: true,
17
+ // jest: true,
18
+ // node: true,
19
+ // },
20
+ // extends: [
21
+ // 'airbnb',
22
+ // 'standard',
23
+ // 'standard-react',
24
+ // 'plugin:jest/recommended',
25
+ // 'plugin:cypress/recommended',
26
+ // 'prettier',
27
+ // ],
28
+ // plugins: ['jest'],
29
+ // ignorePatterns: [
30
+ // '_build',
31
+ // 'dist',
32
+ // '!.storybook',
33
+ // '!.commitlintrc.js',
34
+ // '!.cz-config.js',
35
+ // '!.eslintrc.js',
36
+ // '!.jest.config.js',
37
+ // '!.lintstagedrc.js',
38
+ // '!.prettierrc.js',
39
+ // '!.stylelintrc.js',
40
+ // '**/node_modules',
41
+ // ],
42
+ // rules: {
43
+ // 'arrow-body-style': 0,
44
+ // 'import/no-extraneous-dependencies': [
45
+ // 'error',
46
+ // {
47
+ // devDependencies: [
48
+ // // storybook
49
+ // '.storybook/*',
50
+ // '**/stories/**/*.js',
51
51
 
52
- // tests
53
- 'cypress/**',
54
- '**/*.spec.js',
55
- '**/*.test.js',
52
+ // // tests
53
+ // 'cypress/**',
54
+ // '**/*.spec.js',
55
+ // '**/*.test.js',
56
56
 
57
- // webpack
58
- 'webpack/**',
57
+ // // webpack
58
+ // 'webpack/**',
59
59
 
60
- // configs
61
- '.commitlintrc.js',
62
- '.cz-config.js',
63
- '.eslintrc.js',
64
- '.jest.config.js',
65
- '.lintstagedrc.js',
66
- '.prettierrc.js',
67
- '.stylelintrc.js',
60
+ // // configs
61
+ // '.commitlintrc.js',
62
+ // '.cz-config.js',
63
+ // '.eslintrc.js',
64
+ // '.jest.config.js',
65
+ // '.lintstagedrc.js',
66
+ // '.prettierrc.js',
67
+ // '.stylelintrc.js',
68
68
 
69
- // other
70
- 'dev/**',
71
- ],
72
- },
73
- ],
74
- 'jsx-a11y/anchor-is-valid': [
75
- 'error',
76
- {
77
- components: ['Link'],
78
- specialLink: ['to', 'hrefLeft', 'hrefRight'],
79
- aspects: ['noHref', 'invalidHref', 'preferButton'],
80
- },
81
- ],
82
- 'no-console': ['error', { allow: ['warn', 'error'] }],
83
- 'padding-line-between-statements': [
84
- 'error',
85
- { blankLine: 'always', prev: '*', next: 'block' },
86
- { blankLine: 'always', prev: 'block', next: '*' },
87
- { blankLine: 'always', prev: '*', next: 'block-like' },
88
- { blankLine: 'always', prev: 'block-like', next: '*' },
89
- { blankLine: 'always', prev: '*', next: 'multiline-const' },
90
- { blankLine: 'always', prev: 'multiline-const', next: '*' },
91
- ],
92
- // 'prettier/prettier': 'error',
93
- 'react/function-component-definition': [
94
- 2,
95
- { namedComponents: 'arrow-function' },
96
- ],
97
- 'react/jsx-filename-extension': [2, { extensions: ['.js'] }], // disallows .jsx files
98
- 'react/jsx-props-no-spreading': 0,
99
- 'react/jsx-sort-props': [1, { ignoreCase: true }],
100
- 'react/prop-types': [
101
- 2,
102
- { ignore: ['children', 'className', 'onClick', 'theme'] },
103
- ],
104
- // 'sort-keys': [1, 'asc', { caseSensitive: false }],
105
- },
106
- }
69
+ // // other
70
+ // 'dev/**',
71
+ // ],
72
+ // },
73
+ // ],
74
+ // 'jsx-a11y/anchor-is-valid': [
75
+ // 'error',
76
+ // {
77
+ // components: ['Link'],
78
+ // specialLink: ['to', 'hrefLeft', 'hrefRight'],
79
+ // aspects: ['noHref', 'invalidHref', 'preferButton'],
80
+ // },
81
+ // ],
82
+ // 'no-console': ['error', { allow: ['warn', 'error'] }],
83
+ // 'padding-line-between-statements': [
84
+ // 'error',
85
+ // { blankLine: 'always', prev: '*', next: 'block' },
86
+ // { blankLine: 'always', prev: 'block', next: '*' },
87
+ // { blankLine: 'always', prev: '*', next: 'block-like' },
88
+ // { blankLine: 'always', prev: 'block-like', next: '*' },
89
+ // { blankLine: 'always', prev: '*', next: 'multiline-const' },
90
+ // { blankLine: 'always', prev: 'multiline-const', next: '*' },
91
+ // ],
92
+ // // 'prettier/prettier': 'error',
93
+ // 'react/function-component-definition': [
94
+ // 2,
95
+ // { namedComponents: 'arrow-function' },
96
+ // ],
97
+ // 'react/jsx-filename-extension': [2, { extensions: ['.js'] }], // disallows .jsx files
98
+ // 'react/jsx-props-no-spreading': 0,
99
+ // 'react/jsx-sort-props': [1, { ignoreCase: true }],
100
+ // 'react/prop-types': [
101
+ // 2,
102
+ // { ignore: ['children', 'className', 'onClick', 'theme'] },
103
+ // ],
104
+ // // 'sort-keys': [1, 'asc', { caseSensitive: false }],
105
+ // },
106
+ // }
package/src/eslint.mjs CHANGED
@@ -1,35 +1,18 @@
1
1
  import { defineConfig, globalIgnores } from 'eslint/config'
2
2
  import js from '@eslint/js'
3
-
4
3
  import globals from 'globals'
5
4
  import tseslint from 'typescript-eslint'
6
5
  import importPlugin from 'eslint-plugin-import'
7
6
  import workspaces from 'eslint-plugin-workspaces'
8
-
7
+ import pluginPromise from 'eslint-plugin-promise'
9
8
  import nodePlugin from 'eslint-plugin-n'
10
-
9
+ import pluginCypress from 'eslint-plugin-cypress'
10
+ import vitest from '@vitest/eslint-plugin'
11
11
  import react from 'eslint-plugin-react'
12
12
  import reactHooks from 'eslint-plugin-react-hooks'
13
13
  import jsxA11y from 'eslint-plugin-jsx-a11y'
14
14
  import confusingBrowserGlobals from 'confusing-browser-globals'
15
15
 
16
- import vitest from '@vitest/eslint-plugin'
17
- // import jest from 'eslint-plugin-jest'
18
- // import cypressPlugin from 'eslint-plugin-cypress'
19
-
20
- /**
21
- * TO DO
22
- *
23
- * explicit rules from old config
24
- * jest
25
- * cypress
26
- *
27
- * => drop dependencies
28
- * airbnb
29
- * babel eslint parser
30
- *
31
- */
32
-
33
16
  const commonRules = {
34
17
  'array-callback-return': 'error',
35
18
  'block-scoped-var': 'error',
@@ -118,15 +101,9 @@ const commonRules = {
118
101
  '**/vitest.config.*',
119
102
 
120
103
  // configs
121
- '.commitlintrc.js',
122
- '.commitlintrc.ts',
123
- '.commitlintrc.mjs',
124
104
  '.cz-config.js',
125
105
  '.cz-config.ts',
126
106
  '.cz-config.mjs',
127
- '.jest.config.js',
128
- '.jest.config.ts',
129
- '.jest.config.mjs',
130
107
  '.lintstagedrc.js',
131
108
  '.lintstagedrc.ts',
132
109
  '.lintstagedrc.mjs',
@@ -206,9 +183,7 @@ const globalIgnoreList = [
206
183
  '**/dist',
207
184
  '**/docs',
208
185
  '!**/.storybook',
209
- '!**/.commitlintrc.js',
210
186
  '!**/.cz-config.js',
211
- '!**/.jest.config.js',
212
187
  '!**/.lintstagedrc.js',
213
188
  '!**/.prettierrc.js',
214
189
  '!**/.stylelintrc.js',
@@ -218,6 +193,7 @@ const globalIgnoreList = [
218
193
  const server = [
219
194
  js.configs.recommended,
220
195
  importPlugin.flatConfigs.recommended,
196
+ pluginPromise.configs['flat/recommended'],
221
197
  workspacesConfig,
222
198
 
223
199
  {
@@ -270,6 +246,7 @@ const server = [
270
246
  const client = [
271
247
  js.configs.recommended,
272
248
  importPlugin.flatConfigs.recommended,
249
+ pluginPromise.configs['flat/recommended'],
273
250
  workspacesConfig,
274
251
  react.configs.flat.recommended,
275
252
  react.configs.flat['jsx-runtime'],
@@ -279,7 +256,10 @@ const client = [
279
256
  {
280
257
  files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
281
258
  languageOptions: {
282
- globals: { ...globals.browser },
259
+ globals: {
260
+ ...globals.browser,
261
+ process: 'readonly',
262
+ },
283
263
  ecmaVersion: 'latest',
284
264
  parserOptions: {
285
265
  ecmaFeatures: {
@@ -311,8 +291,18 @@ const client = [
311
291
  globalIgnores(globalIgnoreList),
312
292
  ]
313
293
 
294
+ const root = [
295
+ ...server,
296
+
297
+ {
298
+ files: ['cypress/**/*.{js,mjs,ts}'],
299
+ extends: [pluginCypress.configs.recommended],
300
+ },
301
+ ]
302
+
314
303
  export {
315
304
  defineConfig as defineEslintConfig,
316
305
  server as serverEslintConfig,
317
306
  client as clientEslintConfig,
307
+ root as rootEslintConfig,
318
308
  }
package/src/stylelint.mjs CHANGED
@@ -1,27 +1,16 @@
1
1
  export default {
2
- extends: [
3
- 'stylelint-config-standard-scss',
4
- 'stylelint-config-styled-components',
2
+ extends: ['stylelint-config-standard'],
3
+ overrides: [
4
+ {
5
+ files: ['**/*.{js,jsx,mjs,mts,ts,tsx}'],
6
+ customSyntax: 'postcss-styled-syntax',
7
+ },
5
8
  ],
6
- customSyntax: 'postcss-scss',
7
- ignoreFiles: ['_build'],
8
- plugins: ['stylelint-order'],
9
- processors: ['stylelint-processor-styled-components'],
10
9
  rules: {
11
- 'declaration-no-important': true,
12
- // 'order/order': ['declarations', 'rules', 'at-rules'],
13
- 'order/order': null,
14
- 'order/properties-alphabetical-order': true,
15
- 'rule-empty-line-before': [
16
- 'always',
17
- { ignore: ['first-nested', 'after-comment'] },
18
- ],
19
-
20
- 'value-keyword-case': null,
21
10
  'comment-empty-line-before': null,
22
- 'declaration-colon-newline-after': null,
23
- 'keyframes-name-pattern': null,
24
11
  'declaration-empty-line-before': null,
25
- 'selector-class-pattern': null,
12
+ 'declaration-block-no-duplicate-properties': true,
13
+ 'declaration-no-important': true,
14
+ 'no-descending-specificity': null,
26
15
  },
27
16
  }