-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'node-20-2' into upgrade-packages
- Loading branch information
Showing
154 changed files
with
4,538 additions
and
9,455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
const sharedPlugins = ['import', 'jest', 'prettier', 'standard']; | ||
|
||
const sharedExtends = [ | ||
'standard', | ||
'prettier', | ||
'plugin:prettier/recommended', // Should be the last extension https://github.com/prettier/eslint-plugin-prettier#recommended-configuration | ||
]; | ||
|
||
const sharedRules = { | ||
'eol-last': 'error', | ||
'import/order': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
['builtin', 'external'], | ||
['internal', 'sibling', 'parent', 'index'], | ||
], | ||
pathGroups: [ | ||
{ | ||
pattern: '@weco/**', | ||
group: 'external', | ||
position: 'after', | ||
}, | ||
], | ||
pathGroupsExcludedImportTypes: ['builtin', 'object'], | ||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: true, | ||
}, | ||
'newlines-between': 'always', | ||
}, | ||
], | ||
'no-mixed-operators': 'warn', | ||
'no-multi-spaces': 'warn', | ||
'no-multi-str': 'off', | ||
'no-restricted-imports': [ | ||
'error', | ||
{ patterns: ['../*'] }, // Should only import relatively from same directory | ||
], | ||
'no-restricted-syntax': [ | ||
'error', | ||
"JSXElement.children > [expression.callee.property.name='stringify']", | ||
], | ||
'no-return-assign': 'off', | ||
'prettier/prettier': 'error', | ||
'sort-imports': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
ignoreDeclarationSort: true, | ||
}, | ||
], | ||
}; | ||
|
||
const ignorePatterns = [ | ||
'/**/node_modules/', | ||
'/**/libs/', | ||
'/**/lib/', | ||
'/**/_next/', | ||
'/**/dist/', | ||
]; | ||
|
||
module.exports = { | ||
parser: '@babel/eslint-parser', | ||
plugins: sharedPlugins, | ||
env: { | ||
'jest/globals': true, | ||
}, | ||
extends: sharedExtends, | ||
ignorePatterns, | ||
rules: sharedRules, | ||
reportUnusedDisableDirectives: true, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
requireConfigFile: false, | ||
}, | ||
overrides: [ | ||
{ | ||
// we have non-test files in the pipeline/test directory | ||
// this ensures the jest rules only apply to test files | ||
files: ['*test.ts'], | ||
extends: ['plugin:jest/recommended'], | ||
}, | ||
{ | ||
files: ['*.ts'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: [...sharedPlugins, '@typescript-eslint'], | ||
extends: [...sharedExtends, 'plugin:@typescript-eslint/recommended'], | ||
rules: { | ||
...sharedRules, | ||
'no-use-before-define': 'off', | ||
'@typescript-eslint/array-type': ['error'], | ||
'@typescript-eslint/no-use-before-define': [ | ||
'error', | ||
{ functions: false }, | ||
], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ ignoreRestSiblings: true }, | ||
], | ||
'jest/no-standalone-expect': [ | ||
'error', | ||
{ additionalTestBlockFunctions: ['each.test'] }, | ||
], | ||
}, | ||
}, | ||
// Some directories don't have an absolute import equivalent so ignoring | ||
// import rules for them. | ||
{ | ||
files: ['webhook/**'], | ||
rules: { | ||
'no-restricted-imports': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'Typescript' | ||
on: | ||
push: | ||
|
||
jobs: | ||
tsc: | ||
name: tsc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: install Node | ||
# https://github.com/actions/setup-node?tab=readme-ov-file#usage | ||
# The node-version input is optional. If not supplied, the node version from PATH will be used. | ||
# However, it is recommended to always specify Node.js version and don't rely on the system one. | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: yarn tsc | ||
run: yarn install && yarn tsc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
endOfLine: 'auto', | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
// We add this to avoid having linting commits in CI | ||
"editor.tabSize": 2, | ||
"files.encoding": "utf8", | ||
"editor.codeActionsOnSave": { | ||
"editor.insertSpaces": "explicit", | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.stylelint": "explicit", | ||
"files.trimTrailingWhitespace": "explicit" | ||
}, | ||
"stylelint.validate": ["typescriptreact"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.