Skip to content

Commit

Permalink
Switch to standard style formatting, but using prettier because stand…
Browse files Browse the repository at this point in the history
…ard's typescript support is wonky

See standard/standardx#27
  • Loading branch information
airhorns authored and mcollina committed Sep 14, 2020
1 parent e5e49fd commit 27feaa4
Show file tree
Hide file tree
Showing 26 changed files with 988 additions and 984 deletions.
30 changes: 16 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
sourceType: 'module', // Allows for the use of imports
project: './tsconfig.json',
},
settings: {
react: {
version: "detect", // Tells eslint-plugin-react to automatically detect the version of React to use
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
extends: [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
},
};
}
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"printWidth": 120,
"tabWidth": 2
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"scripts": {
"build": "rm -rf ./build && mkdir build && tsc && git rev-parse HEAD > BUILD_SHA",
"lint": "eslint '*/**/*.{js,ts,tsx}'",
"lintfix": "prettier --loglevel warn --write \"src/**/*.{ts,tsx}\" && eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
"lint:fix": "prettier --loglevel warn --write \"src/**/*.{ts,tsx}\" && eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
"prepublishOnly": "yarn run build",
"test": "yarn run build && yarn run test:unit",
"test": "yarn run build && yarn run test:unit && yarn run lint",
"test:unit": "jest"
},
"repository": {
Expand Down

0 comments on commit 27feaa4

Please sign in to comment.