Skip to content

Commit

Permalink
Migration to typescript Step 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Janther committed Jan 7, 2024
1 parent fa0b75e commit 2da90a6
Show file tree
Hide file tree
Showing 89 changed files with 1,552 additions and 787 deletions.
9 changes: 5 additions & 4 deletions .c8rc
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"check-coverage": true,
"branches": 99,
"lines": 100,
"branches": 97,
"lines": 99,
"functions": 100,
"statements": 100,
"statements": 99,
"exclude": ["/node_modules/", "/src/prettier-comments/"],
"include": [
"src/**/*.js",
"!src/prettier-comments/**/*.js",
"src/**/*.ts",
"!src/prettier-comments/**/*.ts",
"!src/common/backward-compatibility.js"
],
"reporter": ["lcov", "text"],
Expand Down
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
coverage/**/*.js
dist/**/*.js
dist/**/*.cjs
tests/**/*.snap
tests/format/**/*.sol
tests/format/Markdown/Markdown.md
tests/format/RespectDefaultOptions/respect-default-options.js
tests/config/**/*.*js
src/prettier-comments/**/*.js
src/prettier-comments/**/*.ts
37 changes: 27 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,33 @@
"env": {
"jest": true
},
"extends": ["airbnb-base", "prettier"],
"globals": {
"run_spec": false
"run_spec": "readonly"
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"import/extensions": "off",
"import/prefer-default-export": "off"
}
"overrides": [
{
"files": ["**/*.ts"],
"extends": ["prettier", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"project": ["tsconfig.json"]
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "error"
}
},
{
"files": ["**/*.*js"],
"extends": ["airbnb-base", "prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"import/extensions": "off",
"import/prefer-default-export": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ dist/**/*.js
tests/format/**/*.sol
tests/format/Markdown/Markdown.md
tests/format/RespectDefaultOptions/respect-default-options.js
src/prettier-comments/**/*.js
src/prettier-comments/**/*.ts
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const TEST_STANDALONE = Boolean(process.env.TEST_STANDALONE);
const testMatch = [
'<rootDir>/tests/format/**/jsfmt.spec.js',

'<rootDir>/tests/unit/**/*.test.js'
];

Expand All @@ -11,12 +10,11 @@ if (TEST_STANDALONE) {

export default {
runner: 'jest-light-runner',
setupFiles: ['<rootDir>/tests/config/setup.js'],
setupFiles: ['<rootDir>/tests/config/format-test-setup.js'],
snapshotSerializers: [
'jest-snapshot-serializer-raw',
'jest-snapshot-serializer-ansi'
],
testEnvironment: 'node',
// ignore console warnings in TEST_STANDALONE
silent: TEST_STANDALONE,
testPathIgnorePatterns: TEST_STANDALONE
Expand All @@ -27,7 +25,6 @@ export default {
]
: [],
testMatch,
transform: {},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
Expand Down
Loading

0 comments on commit 2da90a6

Please sign in to comment.