Skip to content

Commit

Permalink
Merge pull request #2 from salesforce/toTypescript
Browse files Browse the repository at this point in the history
use Typescript instead of JS to improve dev productivity
  • Loading branch information
ben-zhang-at-salesforce authored May 14, 2024
2 parents c6516ad + 59b476e commit 7cb2113
Show file tree
Hide file tree
Showing 17 changed files with 1,217 additions and 911 deletions.
15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules
/reports
/dist
test-report.xml
junit.xml

tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"internalConsoleOptions": "neverOpen"
}
]
}
}
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2024, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/

import eslint from '@eslint/js';
import tsEslint from 'typescript-eslint';

export default tsEslint.config(
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,

{
rules: {
strict: ['error', 'global'],
'@typescript-eslint/no-extra-non-null-assertion': 'off'
}
},
);
17 changes: 10 additions & 7 deletions jest.config.js → jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/

'use strict';
import type { Config } from 'jest';

module.exports = {
const config: Config = {
displayName: 'Unit Tests',
setupFilesAfterEnv: ['jest-extended', 'jest-chain'],
preset: 'ts-jest',
testMatch: [
'<rootDir>/test/plugin.js',
'<rootDir>/test/lib/rules/**/*.js',
'!**/test/lib/rules/shared.js'
'<rootDir>/test/plugin.ts',
'<rootDir>/test/rules/**/*.ts',
'!**/test/rules/shared.ts'
],
moduleFileExtensions: ['js', 'json'],
moduleFileExtensions: ['ts', 'js', 'json'],
testResultsProcessor: 'jest-sonar-reporter',
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/lib/'],
moduleDirectories: ['node_modules'],
collectCoverage: true,
collectCoverageFrom: ['lib/**/*.js'],
collectCoverageFrom: ['src/**/*.ts'],
coverageDirectory: 'reports/coverage',
reporters: [
'default',
Expand All @@ -33,3 +34,5 @@ module.exports = {
]
]
};

export default config;
23 changes: 0 additions & 23 deletions lib/index.js

This file was deleted.

60 changes: 0 additions & 60 deletions lib/rules/enforce-foo-bar.js

This file was deleted.

Loading

0 comments on commit 7cb2113

Please sign in to comment.