Skip to content

Commit

Permalink
Merge branch 'toTypescript' into FirstMobileGQL
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeng-li-at-salesforce committed May 10, 2024
2 parents 3c59b94 + 18ff9c5 commit 31779e4
Show file tree
Hide file tree
Showing 7 changed files with 473 additions and 425 deletions.
1 change: 0 additions & 1 deletion eslint.config.js → eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default tsEslint.config(
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,

{
rules: {
strict: ['error', 'global'],
Expand Down
866 changes: 459 additions & 407 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,8 @@
},
"type": "commonjs",
"main": "dist/src/index.js",
"directories": {
"lib": "lib",
"rules": "lib/rules",
"configs": "lib/configs",
"test": "test"
},
"files": [
"/dist",
"!**/test/"
"/dist"
],
"devDependencies": {
"@eslint/js": "^9.2.0",
Expand All @@ -82,6 +75,7 @@
"jest-sonar-reporter": "^2.0.0",
"prettier": "^3.0.2",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.8.0"
},
Expand All @@ -91,5 +85,4 @@
"volta": {
"node": "18.18.2"
}

}
5 changes: 3 additions & 2 deletions src/configs/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';

export default {
export = {
plugins: ['@salesforce/lwc-mobile']
};
} satisfies ClassicConfig.Config;
8 changes: 5 additions & 3 deletions src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';

export default {
export = {
extends: ['./configs/base'],
rules: {
'@salesforce/lwc-mobile/enforce-foo-bar': 'warn'
'@salesforce/lwc-mobile/enforce-foo-bar': 'warn',
'@salesforce/lwc-mobile/no-more-than-2-fields': 'warn'
}
};
} satisfies ClassicConfig.Config;
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

import base from './configs/base.js';
import recommended from './configs/recommended.js';

import enforceFooBar from './rules/dummy/enforce-foo-bar.js';
import { rule as noMoreThan2Fields } from './rules/graphql/no-more-than-2-fields.js';
export default {
export = {
rules: {
'enforce-foo-bar': enforceFooBar,
'no-more-than-2-fields': noMoreThan2Fields
Expand Down
4 changes: 2 additions & 2 deletions src/rules/dummy/enforce-foo-bar.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';

type MessageIds = 'messageIdForFooMustBeBar';
type MessageIds = 'messageIdForFooMustBeBar';

const ruleEnforceFoorBar: TSESLint.RuleModule<MessageIds> = {
const ruleEnforceFoorBar: TSESLint.RuleModule<MessageIds> = {
defaultOptions: [],
meta: {
type: 'problem',
Expand Down

0 comments on commit 31779e4

Please sign in to comment.