@perfective/eslint-config 0.26.0 → 0.26.1

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/config/node.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasNodeModule = void 0;
3
+ exports.hasNodeModule = hasNodeModule;
4
4
  function hasNodeModule(module) {
5
5
  try {
6
6
  return Boolean(require.resolve(module));
@@ -9,4 +9,3 @@ function hasNodeModule(module) {
9
9
  return false;
10
10
  }
11
11
  }
12
- exports.hasNodeModule = hasNodeModule;
package/config/plugin.js CHANGED
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasEslintPlugin = exports.optionalRule = exports.optionalRules = exports.optionalOverrides = exports.optionalConfig = void 0;
3
+ exports.optionalConfig = optionalConfig;
4
+ exports.optionalOverrides = optionalOverrides;
5
+ exports.optionalRules = optionalRules;
6
+ exports.optionalRule = optionalRule;
7
+ exports.hasEslintPlugin = hasEslintPlugin;
4
8
  const node_1 = require("./node");
5
9
  function optionalConfig(plugin, rules) {
6
10
  if (hasEslintPlugin(plugin)) {
@@ -11,21 +15,18 @@ function optionalConfig(plugin, rules) {
11
15
  }
12
16
  return {};
13
17
  }
14
- exports.optionalConfig = optionalConfig;
15
18
  function optionalOverrides(plugin, overrides) {
16
19
  if (hasEslintPlugin(plugin)) {
17
20
  return overrides;
18
21
  }
19
22
  return null;
20
23
  }
21
- exports.optionalOverrides = optionalOverrides;
22
24
  function optionalRules(plugin) {
23
25
  if (hasEslintPlugin(plugin)) {
24
26
  return `./rules/${plugin.replace(/^@/u, '')}`;
25
27
  }
26
28
  return null;
27
29
  }
28
- exports.optionalRules = optionalRules;
29
30
  function optionalRule(rule, config) {
30
31
  const plugin = pluginOfRule(rule);
31
32
  if (plugin === null) {
@@ -38,14 +39,12 @@ function optionalRule(rule, config) {
38
39
  }
39
40
  return {};
40
41
  }
41
- exports.optionalRule = optionalRule;
42
42
  function hasEslintPlugin(plugin) {
43
43
  if (plugin.startsWith('@')) {
44
44
  return (0, node_1.hasNodeModule)(`${plugin}/eslint-plugin`);
45
45
  }
46
46
  return (0, node_1.hasNodeModule)(`eslint-plugin-${plugin}`);
47
47
  }
48
- exports.hasEslintPlugin = hasEslintPlugin;
49
48
  function pluginOfRule(rule) {
50
49
  const parts = rule.split('/');
51
50
  if (parts.length > 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "ESLint shareable rules configuration",
5
5
  "keywords": ["code quality", "code standard", "code style", "eslint", "eslint config", "lint", "perfective", "tslint", "tslint config", "typescript"],
6
6
  "author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
@@ -12,10 +12,10 @@
12
12
  "license": "MIT",
13
13
  "peerDependencies": {
14
14
  "@babel/eslint-parser": "^7.24.7",
15
- "@stylistic/eslint-plugin": "^2.2.2",
16
- "@typescript-eslint/eslint-plugin": "^7.13.1",
15
+ "@stylistic/eslint-plugin": "^2.3.0",
16
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
17
17
  "@typescript-eslint/eslint-plugin-tslint": "^7.0.2",
18
- "@typescript-eslint/parser": "^7.13.1",
18
+ "@typescript-eslint/parser": "^7.14.1",
19
19
  "eslint": "^8.57.0",
20
20
  "eslint-import-resolver-typescript": "^3.6.1",
21
21
  "eslint-plugin-array-func": "^4.0.0",
@@ -26,7 +26,7 @@
26
26
  "eslint-plugin-jest": "^28.6.0",
27
27
  "eslint-plugin-jest-dom": "^5.4.0",
28
28
  "eslint-plugin-jest-formatting": "^3.1.0",
29
- "eslint-plugin-jsdoc": "^48.2.12",
29
+ "eslint-plugin-jsdoc": "^48.5.0",
30
30
  "eslint-plugin-n": "^17.9.0",
31
31
  "eslint-plugin-prefer-arrow": "^1.2.3",
32
32
  "eslint-plugin-promise": "^6.2.0",
@@ -1,25 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cypressImportNoExtraneousDependencies = exports.jestImportNoExtraneousDependencies = exports.jsImportNoExtraneousDependencies = exports.importNoExtraneousDependencies = void 0;
3
+ exports.importNoExtraneousDependencies = importNoExtraneousDependencies;
4
+ exports.jsImportNoExtraneousDependencies = jsImportNoExtraneousDependencies;
5
+ exports.jestImportNoExtraneousDependencies = jestImportNoExtraneousDependencies;
6
+ exports.cypressImportNoExtraneousDependencies = cypressImportNoExtraneousDependencies;
4
7
  function importNoExtraneousDependencies(overrides = {}) {
5
8
  return Object.assign({ bundledDependencies: true, devDependencies: false, optionalDependencies: false, peerDependencies: false }, overrides);
6
9
  }
7
- exports.importNoExtraneousDependencies = importNoExtraneousDependencies;
8
10
  function jsImportNoExtraneousDependencies(devDependencies = ['**/.*.js', '**/*.config.js', '**/gulpfile.js']) {
9
11
  return importNoExtraneousDependencies({
10
12
  devDependencies,
11
13
  });
12
14
  }
13
- exports.jsImportNoExtraneousDependencies = jsImportNoExtraneousDependencies;
14
15
  function jestImportNoExtraneousDependencies(devDependencies = ['**/*.@(spec|test).[jt]s?(x)']) {
15
16
  return importNoExtraneousDependencies({
16
17
  devDependencies,
17
18
  });
18
19
  }
19
- exports.jestImportNoExtraneousDependencies = jestImportNoExtraneousDependencies;
20
20
  function cypressImportNoExtraneousDependencies(devDependencies = ['cypress/**/*.[jt]s']) {
21
21
  return importNoExtraneousDependencies({
22
22
  devDependencies,
23
23
  });
24
24
  }
25
- exports.cypressImportNoExtraneousDependencies = cypressImportNoExtraneousDependencies;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.internalPackages = exports.scopedPackages = exports.simpleImportSortImports = void 0;
3
+ exports.simpleImportSortImports = simpleImportSortImports;
4
+ exports.scopedPackages = scopedPackages;
5
+ exports.internalPackages = internalPackages;
4
6
  function simpleImportSortImports(internal = []) {
5
7
  return {
6
8
  groups: [
@@ -15,7 +17,6 @@ function simpleImportSortImports(internal = []) {
15
17
  ].filter(group => group.length > 0),
16
18
  };
17
19
  }
18
- exports.simpleImportSortImports = simpleImportSortImports;
19
20
  function sideEffects() {
20
21
  return ['^\\u0000'];
21
22
  }
@@ -31,11 +32,9 @@ function scopedPackages(exclude) {
31
32
  }
32
33
  return [`^(?!${exclude.join('|')})@`];
33
34
  }
34
- exports.scopedPackages = scopedPackages;
35
35
  function internalPackages(internal) {
36
36
  return internal.map(scope => [`^${scope}`]);
37
37
  }
38
- exports.internalPackages = internalPackages;
39
38
  function parentImports() {
40
39
  return ['^\\.\\.(?!/?$)', '^\\.\\./?$'];
41
40
  }
@@ -28,10 +28,7 @@ module.exports = {
28
28
  '@stylistic/jsx/jsx-equals-spacing': ['warn', 'never'],
29
29
  '@stylistic/jsx/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
30
30
  '@stylistic/jsx/jsx-function-call-newline': ['warn', 'multiline'],
31
- '@stylistic/jsx/jsx-indent': ['warn', 4, {
32
- checkAttributes: true,
33
- indentLogicalExpressions: true,
34
- }],
31
+ '@stylistic/jsx/jsx-indent': 'off',
35
32
  '@stylistic/jsx/jsx-indent-props': ['warn', {
36
33
  indentMode: 1,
37
34
  ignoreTernaryOperator: false,
@@ -91,11 +91,20 @@ module.exports = {
91
91
  }],
92
92
  '@stylistic/js/no-extra-semi': 'off',
93
93
  '@stylistic/ts/no-extra-semi': 'warn',
94
+ '@stylistic/js/object-curly-newline': 'off',
95
+ '@stylistic/ts/object-curly-newline': ['warn', {
96
+ ImportDeclaration: { multiline: true },
97
+ ExportDeclaration: { multiline: true },
98
+ }],
94
99
  '@stylistic/js/object-curly-spacing': 'off',
95
100
  '@stylistic/ts/object-curly-spacing': ['warn', 'always', {
96
101
  arraysInObjects: true,
97
102
  objectsInObjects: true,
98
103
  }],
104
+ '@stylistic/js/object-property-newline': 'off',
105
+ '@stylistic/ts/object-property-newline': ['warn', {
106
+ allowAllPropertiesOnSameLine: true,
107
+ }],
99
108
  '@stylistic/js/padding-line-between-statements': 'off',
100
109
  '@stylistic/ts/padding-line-between-statements': 'off',
101
110
  '@stylistic/js/quote-props': 'off',
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typescriptEslintNamingConvention = void 0;
3
+ exports.typescriptEslintNamingConvention = typescriptEslintNamingConvention;
4
4
  function typescriptEslintNamingConvention(extensions = []) {
5
5
  return typescriptEslintNamingConventionDefaults()
6
6
  .concat(extensions);
7
7
  }
8
- exports.typescriptEslintNamingConvention = typescriptEslintNamingConvention;
9
8
  function typescriptEslintNamingConventionDefaults() {
10
9
  return [
11
10
  {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typescriptEslintTslintConfig = void 0;
3
+ exports.typescriptEslintTslintConfig = typescriptEslintTslintConfig;
4
4
  const format = {
5
5
  'import-spacing': true,
6
6
  };
@@ -32,4 +32,3 @@ function typescriptEslintTslintConfig(rules = {}, directories = []) {
32
32
  rulesDirectory: directories,
33
33
  };
34
34
  }
35
- exports.typescriptEslintTslintConfig = typescriptEslintTslintConfig;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unicornPreventAbbreviations = void 0;
3
+ exports.unicornPreventAbbreviations = unicornPreventAbbreviations;
4
4
  function unicornPreventAbbreviations(replacements = {}, options = {}) {
5
5
  return Object.assign(Object.assign({ replacements: Object.assign({ arg: false, args: false, db: false, doc: false, docs: false, dev: false, env: false, i: false, j: false, lib: false, libs: false, param: false, params: false }, replacements), extendDefaultReplacements: true, allowList: {}, extendDefaultAllowList: true, checkDefaultAndNamespaceImports: 'internal', checkShorthandImports: 'internal', checkShorthandProperties: false, checkProperties: false, checkVariables: true, checkFilenames: true }, options), { ignore: [
6
6
  /e2e/u,
7
7
  ] });
8
8
  }
9
- exports.unicornPreventAbbreviations = unicornPreventAbbreviations;