@gossi/config-eslint
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -54,2 +54,3 @@ 'use strict'; | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/typescript-imports')) | ||
@@ -97,2 +98,3 @@ ); | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/typescript-imports')) | ||
@@ -99,0 +101,0 @@ ); |
@@ -22,2 +22,5 @@ 'use strict'; | ||
forFiles(['./**/stories.js', './**/*.stories.js'], config.modules.stories.js), | ||
forFiles(['./**/stories.ts', './**/*.stories.ts'], config.modules.stories.ts), | ||
forFiles( | ||
@@ -37,3 +40,3 @@ [ | ||
forFiles( | ||
'{src,app,addon,addon-test-support,tests,types}/**/*.ts', | ||
'{src,app,addon,addon-test-support,tests,types}/**/!(*.stories|stories).ts', | ||
applyNamingConventions( | ||
@@ -48,12 +51,12 @@ config.modules.browser.ts, | ||
'**/*.d.ts', | ||
applyNamingConventions( | ||
config.modules.browser.declarations, | ||
componentsConventions, | ||
templateRegistryConventions | ||
pipe( | ||
applyNamingConventions( | ||
config.modules.browser.declarations, | ||
componentsConventions, | ||
templateRegistryConventions | ||
), | ||
(config) => merge(config, require('./rules/ember-typescript')) | ||
) | ||
), | ||
forFiles(['./**/stories.js', './**/*.stories.js,'], config.modules.stories.js), | ||
forFiles(['./**/stories.ts', './**/*.stories.ts,'], config.modules.stories.ts), | ||
// ---------------------- | ||
@@ -136,2 +139,4 @@ // Tests | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/ember-typescript')), | ||
(config) => applyNamingConventions(config, emberConventions) | ||
@@ -144,2 +149,3 @@ ); | ||
parser: 'ember-eslint-parser', | ||
extends: ['plugin:ember/recommended-gjs'], | ||
env: { | ||
@@ -150,4 +156,3 @@ browser: true | ||
(config) => merge(config, personalPreferences), | ||
(config) => merge(config, require('./rules/ember')), | ||
(config) => merge(config, require('./rules/ember-gjs')) | ||
(config) => merge(config, require('./rules/ember')) | ||
); | ||
@@ -161,9 +166,12 @@ }, | ||
parser: 'ember-eslint-parser', | ||
extends: ['plugin:ember/recommended-gts'], | ||
env: { | ||
browser: true | ||
} | ||
// parserOptions: typescriptParserOptions | ||
}, | ||
(config) => merge(config, personalPreferences), | ||
(config) => merge(config, require('./rules/ember')), | ||
(config) => merge(config, require('./rules/ember-gts')), | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/ember-typescript')), | ||
(config) => applyNamingConventions(config, emberConventions) | ||
@@ -183,2 +191,4 @@ ); | ||
(config) => merge(config, personalPreferences), | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/typescript-declarations')), | ||
@@ -225,2 +235,3 @@ (config) => applyNamingConventions(config, emberConventions) | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/typescript-imports')) | ||
@@ -251,8 +262,11 @@ ); | ||
browser: true | ||
}, | ||
parserOptions: typescriptParserOptions | ||
} | ||
// parserOptions: typescriptParserOptions | ||
}, | ||
(config) => merge(config, personalPreferences), | ||
(config) => merge(config, require('./rules/ember')), | ||
(config) => merge(config, require('./rules/imports')), | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-imports')), | ||
// (config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/storybook')), | ||
@@ -259,0 +273,0 @@ (config) => applyNamingConventions(config, emberConventions, componentsConventions) |
@@ -104,2 +104,3 @@ 'use strict'; | ||
(config) => merge(config, require('./rules/typescript')), | ||
(config) => merge(config, require('./rules/typescript-typed')), | ||
(config) => merge(config, require('./rules/typescript-imports')) | ||
@@ -106,0 +107,0 @@ ); |
const typescriptParserOptions = { | ||
ecmaVersion: 'latest', | ||
project: true, | ||
extraFileExtensions: ['.gts'] | ||
project: true | ||
}; | ||
module.exports = { typescriptParserOptions }; |
@@ -8,4 +8,5 @@ 'use strict'; | ||
rules: { | ||
// not applicable due to how the runtime is | ||
'@typescript-eslint/no-use-before-define': 'off' | ||
// `void` is a valid type for `Return` signatures, yet TS doesn't recognize | ||
// that as proper return types. | ||
'@typescript-eslint/no-invalid-void-type': 'off' | ||
} | ||
@@ -12,0 +13,0 @@ }; |
'use strict'; | ||
const baseNamingConventions = require('../naming-conventions/base'); | ||
const rule = { | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
extends: ['plugin:@typescript-eslint/recommended'], | ||
rules: { | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
/** | ||
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md#enforce-the-codebase-follows-eslints-camelcase-conventions | ||
*/ | ||
// camelcase: 'off', | ||
'@typescript-eslint/naming-convention': ['error', ...baseNamingConventions] | ||
'@typescript-eslint/no-empty-interface': 'off' | ||
} | ||
@@ -18,0 +7,0 @@ }; |
'use strict'; | ||
const baseNamingConventions = require('../naming-conventions/base'); | ||
/** | ||
@@ -9,6 +7,9 @@ * @type {import('../types').PartialConfig} | ||
const rule = { | ||
// plugins: ['@typescript-eslint'], | ||
extends: ['plugin:@typescript-eslint/recommended-type-checked'] | ||
extends: ['plugin:@typescript-eslint/strict-type-checked'], | ||
rules: { | ||
// much concise | ||
'@typescript-eslint/prefer-optional-chain': 'error' | ||
} | ||
}; | ||
module.exports = { rule }; |
@@ -9,146 +9,95 @@ 'use strict'; | ||
const rule = { | ||
parser: '@typescript-eslint/parser', | ||
// parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
extends: ['plugin:@typescript-eslint/recommended'] | ||
// rules: { | ||
// // this isn't C# | ||
// '@typescript-eslint/interface-name-prefix': 'off', | ||
extends: ['plugin:@typescript-eslint/strict'], | ||
rules: { | ||
// Having an empty interface is plausable when iterating on types, | ||
// extending from an existing type and "planning" to update. | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
// // Having an empty interface is plausable when iterating on types, | ||
// // extending from an existing type and "planning" to update. | ||
// '@typescript-eslint/no-empty-interface': 'off', | ||
// type imports are removed in builds | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
// // type imports are removed in builds | ||
// '@typescript-eslint/consistent-type-imports': 'error', | ||
// prefer inference, but it is recommended to declare | ||
// return types around public API | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
// // prefer inference, but it is recommended to declare | ||
// // return types around public API | ||
// '@typescript-eslint/explicit-function-return-type': 'off', | ||
// '@typescript-eslint/explicit-module-boundary-types': 'off', | ||
// Allows placeholder args to still be defined for | ||
// documentation or "for later" purposes | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
// // much concise | ||
// '@typescript-eslint/prefer-optional-chain': 'error', | ||
// '@typescript-eslint/consistent-type-assertions': [ | ||
// 'error', | ||
// { | ||
// assertionStyle: 'as', | ||
// objectLiteralTypeAssertions: 'allow-as-parameter' | ||
// } | ||
// ], | ||
// // Maximum strictness | ||
// '@typescript-eslint/no-non-null-assertion': 'error', | ||
// Enforce the use of for-of loop over the standard for loop where possible | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
// // Allows placeholder args to still be defined for | ||
// // documentation or "for later" purposes | ||
// '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
'dot-notation': 'warn', | ||
'@typescript-eslint/dot-notation': 'off', | ||
// // no unnecessary comma | ||
// '@typescript-eslint/comma-dangle': ['error'], | ||
'init-declarations': 'off', | ||
'@typescript-eslint/init-declarations': 'warn', | ||
// // Prettier already takes care of indentation | ||
// // indent: 'off', | ||
// '@typescript-eslint/indent': 'off', | ||
'no-use-before-define': 'off', | ||
'@typescript-eslint/no-use-before-define': 'error', | ||
// '@typescript-eslint/consistent-type-assertions': [ | ||
// 'error', | ||
// { | ||
// assertionStyle: 'as', | ||
// objectLiteralTypeAssertions: 'allow-as-parameter' | ||
// } | ||
// ], | ||
'no-invalid-this': 'off', | ||
'@typescript-eslint/no-invalid-this': 'error', | ||
// // 'no-useless-constructor': 'off', | ||
// '@typescript-eslint/no-useless-constructor': 'error', | ||
'lines-between-class-members': 'off', | ||
'@typescript-eslint/lines-between-class-members': [ | ||
'error', | ||
'always', | ||
{ exceptAfterSingleLine: true } | ||
], | ||
// '@typescript-eslint/prefer-for-of': 'error', | ||
/** | ||
* This allows short-circuit idioms, like: | ||
* | ||
* ```js | ||
* this.super && this.super(...arguments); | ||
* | ||
* this.someAction ? this.someAction() : this.fallback(); | ||
* ``` | ||
* | ||
* It disabled the eslint version and instead enables the TS version, to | ||
* properly support optional chaining. | ||
*/ | ||
'no-unused-expressions': 'off', | ||
'@typescript-eslint/no-unused-expressions': [ | ||
'error', | ||
{ allowShortCircuit: true, allowTernary: true } | ||
], | ||
// // 'dot-notation': 'warn', | ||
// '@typescript-eslint/dot-notation': 'off', | ||
'default-param-last': 'off', | ||
'@typescript-eslint/default-param-last': 'error', | ||
// // 'init-declarations': 'off', | ||
// '@typescript-eslint/init-declarations': 'warn', | ||
'no-loop-func': 'off', | ||
'@typescript-eslint/no-loop-func': 'error', | ||
// // 'no-use-before-define': 'off', | ||
// '@typescript-eslint/no-use-before-define': 'error', | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ | ||
ignoreTypeValueShadow: true, | ||
ignoreFunctionTypeParameterNameValueShadow: true | ||
} | ||
], | ||
// // 'no-invalid-this': 'off', | ||
// '@typescript-eslint/no-invalid-this': 'error', | ||
'@typescript-eslint/array-type': 'error', | ||
// // 'lines-between-class-members': 'off', | ||
// '@typescript-eslint/lines-between-class-members': [ | ||
// 'error', | ||
// 'always', | ||
// { exceptAfterSingleLine: true } | ||
// ], | ||
// /** | ||
// * This allows short-circuit idioms, like: | ||
// * | ||
// * ```js | ||
// * this.super && this.super(...arguments); | ||
// * | ||
// * this.someAction ? this.someAction() : this.fallback(); | ||
// * ``` | ||
// * | ||
// * It disabled the eslint version and instead enables the TS version, to | ||
// * properly support optional chaining. | ||
// */ | ||
// // 'no-unused-expressions': 'off', | ||
// '@typescript-eslint/no-unused-expressions': [ | ||
// 'error', | ||
// { allowShortCircuit: true, allowTernary: true } | ||
// ], | ||
// // 'default-param-last': 'off', | ||
// '@typescript-eslint/default-param-last': 'error', | ||
// // 'no-dupe-class-members': 'off', | ||
// '@typescript-eslint/no-dupe-class-members': 'error', | ||
// // 'no-loop-func': 'off', | ||
// '@typescript-eslint/no-loop-func': 'error', | ||
// // 'no-redeclare': 'off', | ||
// '@typescript-eslint/no-redeclare': 'error', | ||
// // 'no-shadow': 'off', | ||
// '@typescript-eslint/no-shadow': 'error', | ||
// /** | ||
// * @note Requires parser services and is thus disabled. | ||
// * | ||
// * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md | ||
// */ | ||
// // 'no-implied-eval': 'off', | ||
// '@typescript-eslint/no-implied-eval': 'off', | ||
// // 'no-magic-numbers': 'off', | ||
// '@typescript-eslint/no-magic-numbers': 'off', | ||
// /** | ||
// * Disallow throwing strings. | ||
// * | ||
// * @note Requires parser services and is thus disabled. | ||
// * | ||
// * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md | ||
// */ | ||
// // 'no-throw-literal': 'off', | ||
// '@typescript-eslint/no-throw-literal': 'off', | ||
// /** | ||
// * Asynchronous functions that don’t use await might not need to be | ||
// * asynchronous functions and could be the unintentional result of | ||
// * refactoring. | ||
// * | ||
// * @note Requires parser services and is thus disabled. | ||
// * | ||
// * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md | ||
// */ | ||
// // 'require-await': 'off', | ||
// '@typescript-eslint/require-await': 'off', | ||
// '@typescript-eslint/array-type': 'error', | ||
// /** | ||
// * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md#enforce-the-codebase-follows-eslints-camelcase-conventions | ||
// */ | ||
// // camelcase: 'off', | ||
// '@typescript-eslint/naming-convention': ['error', ...baseNamingConventions] | ||
// } | ||
/** | ||
* @see https://typescript-eslint.io/rules/naming-convention/#enforce-the-codebase-follows-eslints-camelcase-conventions | ||
*/ | ||
camelcase: 'off', | ||
'@typescript-eslint/naming-convention': ['error', ...baseNamingConventions] | ||
} | ||
}; | ||
module.exports = { rule }; |
{ | ||
"name": "@gossi/config-eslint", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"repository": "https://github.com/gossi/frontend-configs", | ||
"dependencies": { | ||
"cosmiconfig": "^9.0.0", | ||
"eslint-config-prettier": "^8.10.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-decorator-position": "^5.0.2", | ||
@@ -14,3 +14,3 @@ "eslint-plugin-i": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-simple-import-sort": "^10.0.0" | ||
"eslint-plugin-simple-import-sort": "^12.0.0" | ||
}, | ||
@@ -20,4 +20,4 @@ "peerDependencies": { | ||
"@babel/eslint-parser": "^7.22.5", | ||
"@typescript-eslint/eslint-plugin": "^5.59.9 || ^6.0.0", | ||
"@typescript-eslint/parser": "^5.59.9 || ^6.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.59.9 || ^6.0.0 || ^7.0.0", | ||
"@typescript-eslint/parser": "^5.59.9 || ^6.0.0 || ^7.0.0", | ||
"eslint": "^7.0.0 || ^8.0.0", | ||
@@ -57,3 +57,3 @@ "eslint-plugin-ember": "^11.10.0", | ||
"@tsconfig/strictest": "^2.0.5", | ||
"@types/node": "^20.12.2", | ||
"@types/node": "^20.12.5", | ||
"@typescript-eslint/eslint-plugin": "^7.5.0", | ||
@@ -63,3 +63,3 @@ "@typescript-eslint/parser": "^7.5.0", | ||
"eslint-plugin-ember": "^12.0.2", | ||
"eslint-plugin-qunit": "^7.3.4", | ||
"eslint-plugin-qunit": "^8.1.1", | ||
"eslint-plugin-storybook": "^0.8.0", | ||
@@ -66,0 +66,0 @@ "prettier": "^3.2.5", |
51511
37
1620
+ Added@typescript-eslint/eslint-plugin@7.18.0(transitive)
+ Added@typescript-eslint/parser@7.18.0(transitive)
+ Added@typescript-eslint/scope-manager@7.18.0(transitive)
+ Added@typescript-eslint/type-utils@7.18.0(transitive)
+ Added@typescript-eslint/types@7.18.0(transitive)
+ Added@typescript-eslint/typescript-estree@7.18.0(transitive)
+ Added@typescript-eslint/utils@7.18.0(transitive)
+ Added@typescript-eslint/visitor-keys@7.18.0(transitive)
+ Addedeslint-config-prettier@9.1.0(transitive)
+ Addedeslint-plugin-simple-import-sort@12.1.1(transitive)
+ Addedminimatch@9.0.5(transitive)
- Removed@typescript-eslint/eslint-plugin@6.21.0(transitive)
- Removed@typescript-eslint/parser@6.21.0(transitive)
- Removed@typescript-eslint/scope-manager@6.21.0(transitive)
- Removed@typescript-eslint/type-utils@6.21.0(transitive)
- Removed@typescript-eslint/types@6.21.0(transitive)
- Removed@typescript-eslint/typescript-estree@6.21.0(transitive)
- Removed@typescript-eslint/utils@6.21.0(transitive)
- Removed@typescript-eslint/visitor-keys@6.21.0(transitive)
- Removedeslint-config-prettier@8.10.0(transitive)
- Removedeslint-plugin-simple-import-sort@10.0.0(transitive)
- Removedminimatch@9.0.3(transitive)