@cabify/eslint-config 3.0.1-beta-4 → 3.0.1-beta-7
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/configs/base.js +23 -25
- package/configs/best-practices.js +1 -1
- package/configs/errors.js +1 -1
- package/configs/es6.js +1 -1
- package/configs/formats.js +2 -2
- package/configs/imports.js +3 -3
- package/configs/jest.js +2 -2
- package/configs/lodash.js +2 -2
- package/configs/node.js +1 -1
- package/configs/postcss.js +1 -1
- package/configs/promises.js +1 -1
- package/configs/react-a11y.js +2 -2
- package/configs/react.js +3 -3
- package/configs/storybook.js +1 -1
- package/configs/strict.js +1 -1
- package/configs/style.js +1 -1
- package/configs/ts.js +10 -6
- package/configs/variables.js +2 -2
- package/eslint.config.js +3 -2
- package/package.json +9 -4
- package/recommended.js +5 -3
- package/utils.js +11 -11
package/configs/base.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import globals from 'globals';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import { isPackageAvailable } from '../utils.js';
|
|
5
|
+
import bestPractices from './best-practices.js';
|
|
6
|
+
import errors from './errors.js';
|
|
7
|
+
import es6 from './es6.js';
|
|
8
|
+
import formats from './formats.js';
|
|
9
|
+
import imports from './imports.js';
|
|
10
|
+
import jest from './jest.js';
|
|
11
|
+
import lodash from './lodash.js';
|
|
12
|
+
import node from './node.js';
|
|
13
|
+
import postcss from './postcss.js';
|
|
14
|
+
import promises from './promises.js';
|
|
15
|
+
import react from './react.js';
|
|
16
|
+
import reactA11y from './react-a11y.js';
|
|
17
|
+
import storybook from './storybook.js';
|
|
18
|
+
import strict from './strict.js';
|
|
19
|
+
import style from './style.js';
|
|
20
|
+
import ts from './ts.js';
|
|
21
|
+
import variables from './variables.js';
|
|
4
22
|
|
|
5
|
-
const isTSAvailable = isPackageAvailable('typescript');
|
|
6
|
-
const isJestAvailable = isPackageAvailable('jest');
|
|
7
|
-
|
|
8
|
-
const storybook = require('./storybook');
|
|
9
|
-
const ts = require('./ts');
|
|
10
|
-
const postcss = require('./postcss');
|
|
11
|
-
|
|
12
|
-
const bestPractices = require('./best-practices');
|
|
13
|
-
const errors = require('./errors');
|
|
14
|
-
const es6 = require('./es6');
|
|
15
|
-
const imports = require('./imports');
|
|
16
|
-
const node = require('./node');
|
|
17
|
-
const promises = require('./promises');
|
|
18
|
-
const strict = require('./strict');
|
|
19
|
-
const style = require('./style');
|
|
20
|
-
const variables = require('./variables');
|
|
21
|
-
const react = require('./react');
|
|
22
|
-
const lodash = require('./lodash');
|
|
23
|
-
const reactA11y = require('./react-a11y');
|
|
24
|
-
const jest = require('./jest');
|
|
25
|
-
const formats = require('./formats');
|
|
23
|
+
const isTSAvailable = await isPackageAvailable('typescript');
|
|
24
|
+
const isJestAvailable = await isPackageAvailable('jest');
|
|
26
25
|
|
|
27
26
|
const configs = [
|
|
28
27
|
bestPractices,
|
|
@@ -44,7 +43,6 @@ const configs = [
|
|
|
44
43
|
const overrides = [
|
|
45
44
|
isTSAvailable && {
|
|
46
45
|
files: ['**/*.ts', '**/*.tsx'],
|
|
47
|
-
excludedFiles: '*.d.ts',
|
|
48
46
|
...ts,
|
|
49
47
|
},
|
|
50
48
|
{
|
|
@@ -57,7 +55,7 @@ const overrides = [
|
|
|
57
55
|
},
|
|
58
56
|
].filter(Boolean);
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
export default [
|
|
61
59
|
...configs,
|
|
62
60
|
{
|
|
63
61
|
name: 'base-cabify-eslint-config',
|
package/configs/errors.js
CHANGED
package/configs/es6.js
CHANGED
package/configs/formats.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {
|
|
4
4
|
name: 'formats-cabify-eslint-config',
|
|
5
5
|
...eslintPluginPrettierRecommended,
|
|
6
6
|
};
|
package/configs/imports.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import importPlugin from 'eslint-plugin-import';
|
|
2
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default {
|
|
5
5
|
name: 'imports-cabify-eslint-config',
|
|
6
6
|
// languageOptions: {
|
|
7
7
|
// globals: {
|
package/configs/jest.js
CHANGED
package/configs/lodash.js
CHANGED
package/configs/node.js
CHANGED
package/configs/postcss.js
CHANGED
package/configs/promises.js
CHANGED
package/configs/react-a11y.js
CHANGED
package/configs/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import react from 'eslint-plugin-react';
|
|
2
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default {
|
|
5
5
|
name: 'react-cabify-eslint-config',
|
|
6
6
|
plugins: {
|
|
7
7
|
react,
|
package/configs/storybook.js
CHANGED
package/configs/strict.js
CHANGED
package/configs/style.js
CHANGED
package/configs/ts.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line import/no-unresolved
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
2
5
|
name: 'ts-cabify-eslint-config',
|
|
3
|
-
|
|
4
|
-
extends: [
|
|
5
|
-
'plugin:@typescript-eslint/recommended',
|
|
6
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
7
|
-
],
|
|
6
|
+
...tseslint.configs.recommended,
|
|
8
7
|
rules: {
|
|
9
8
|
'@typescript-eslint/restrict-template-expressions': [
|
|
10
9
|
'error',
|
|
@@ -136,4 +135,9 @@ module.exports = {
|
|
|
136
135
|
'no-redeclare': 'off', // superseeded by @typescript-eslint/no-redeclare
|
|
137
136
|
'no-shadow': 'off', // superseeded by @typescript-eslint/no-shadow
|
|
138
137
|
},
|
|
138
|
+
overrides: [
|
|
139
|
+
{
|
|
140
|
+
excludedFiles: '*.d.ts',
|
|
141
|
+
},
|
|
142
|
+
],
|
|
139
143
|
};
|
package/configs/variables.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import confusingBrowserGlobals from 'confusing-browser-globals';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {
|
|
4
4
|
name: 'variables-cabify-eslint-config',
|
|
5
5
|
rules: {
|
|
6
6
|
// enforce or disallow variable initializations at definition
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabify/eslint-config",
|
|
3
|
-
"version": "3.0.1-beta-
|
|
3
|
+
"version": "3.0.1-beta-7",
|
|
4
4
|
"description": "ESLint config for Cabify Javascript projects",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"build": "echo 'No build to perform'",
|
|
7
8
|
"test": "npm run lint:check && npm run format:check",
|
|
@@ -50,15 +51,19 @@
|
|
|
50
51
|
"eslint-plugin-react": "^7.36.0",
|
|
51
52
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
52
53
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
53
|
-
"globals": "^15.9.0"
|
|
54
|
+
"globals": "^15.9.0",
|
|
55
|
+
"typescript-eslint": "^8.8.0"
|
|
54
56
|
},
|
|
55
57
|
"peerDependencies": {
|
|
56
58
|
"eslint": "9.11.0",
|
|
57
59
|
"prettier": ">= 2.2.1"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
|
-
"eslint": "9.11.
|
|
61
|
-
"
|
|
62
|
+
"@eslint/js": "^9.11.1",
|
|
63
|
+
"@types/eslint__js": "^8.42.3",
|
|
64
|
+
"eslint": "^9.11.1",
|
|
65
|
+
"prettier": "3.3.3",
|
|
66
|
+
"typescript": "^5.6.2"
|
|
62
67
|
},
|
|
63
68
|
"publishConfig": {
|
|
64
69
|
"access": "public"
|
package/recommended.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const eslintConfigPrettier = require('eslint-config-prettier');
|
|
1
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
// eslint-disable-next-line import/extensions
|
|
4
|
+
import base from './configs/base.js';
|
|
5
|
+
|
|
6
|
+
export default [...base, eslintConfigPrettier];
|
package/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
3
|
+
export async function isPackageAvailable(packageName) {
|
|
4
|
+
try {
|
|
5
|
+
// Dynamically import the package
|
|
6
|
+
await import(packageName);
|
|
7
|
+
return true;
|
|
8
|
+
} catch (_) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|