diff --git a/.eslintrc.js b/.eslintrc.js index 84b9bee40b..0b6c416759 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,7 +8,7 @@ const svgPresentationAttributes = [ module.exports = { root: true, - extends: ['transloadit'], + extends: ['transloadit', 'prettier'], env: { es6: true, jest: true, @@ -63,7 +63,6 @@ module.exports = { // rules we want to enforce 'array-callback-return': 'error', 'func-names': 'error', - 'implicit-arrow-linebreak': 'error', 'import/no-dynamic-require': 'error', 'import/no-extraneous-dependencies': 'error', 'max-len': 'error', @@ -142,6 +141,7 @@ module.exports = { { files: [ '*.jsx', + '*.tsx', 'packages/@uppy/react-native/**/*.js', ], parser: 'espree', @@ -358,6 +358,7 @@ module.exports = { 'test/**/*.ts', '*.test.js', '*.test-d.ts', + '*.test-d.tsx', 'postcss.config.js', '.eslintrc.js', 'private/**/*.js', @@ -474,11 +475,23 @@ module.exports = { }, }, { - files: ['**/react/*.md/*.js', '**/react.md/*.js', '**/react-*.md/*.js'], + files: ['**/react/*.md/*.js', '**/react.md/*.js', '**/react-*.md/*.js', '**/react/**/*.test-d.tsx'], settings: { react: { pragma: 'React' }, }, }, + { + files: ['**/react/**/*.test-d.tsx'], + rules: { + 'import/extensions': 'off', + 'import/no-useless-path-segments': 'off', + 'no-alert': 'off', + 'no-inner-declarations': 'off', + 'no-lone-blocks': 'off', + 'no-unused-expressions': 'off', + 'no-unused-vars': 'off', + }, + }, { files: ['e2e/**/*.ts'], extends: ['plugin:cypress/recommended'], diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..cfebd2d979 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +node_modules/ +*.js +*.jsx +*.cjs +*.mjs +*.md +*.lock diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000000..df02f7bc1f --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,14 @@ +module.exports = { + proseWrap: 'always', + singleQuote: true, + trailingComma: 'all', + semi: false, + overrides: [ + { + files: 'packages/@uppy/angular/**', + options: { + semi: true, + }, + }, + ], +} diff --git a/e2e/clients/index.html b/e2e/clients/index.html index 05311bd03d..398cc569ae 100644 --- a/e2e/clients/index.html +++ b/e2e/clients/index.html @@ -18,6 +18,6 @@