Skip to content

Commit

Permalink
style: apply linting to whole repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ripecosta committed Dec 20, 2024
1 parent f13e07f commit a0cfd2c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
extends: ['./react'],
extends: [ './react' ],
env: {
browser: true,
node: true,
es2021: true
es2021: true,
},
parserOptions: {
project: './tsconfig.json',
Expand Down
24 changes: 12 additions & 12 deletions base.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module.exports = {
plugins: ['import'],
plugins: [ 'import' ],

rules: {
// -- Generic rules
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-extraneous-dependencies': [ 'error', { devDependencies: true } ],
'import/no-unresolved': 'off',
'newline-before-return': 'error',
'no-console': ['warn'],
'no-console': [ 'warn' ],
'no-restricted-syntax': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'off',
'no-return-assign': ['error', 'except-parens'],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-return-assign': [ 'error', 'except-parens' ],
'no-plusplus': [ 'error', { allowForLoopAfterthoughts: true } ],
'@typescript-eslint/return-await': 'off',

// -- No default exports
Expand All @@ -37,9 +37,9 @@ module.exports = {
{ before: false, after: true, overrides: { arrow: { before: true, after: true } } },
],
'@typescript-eslint/member-delimiter-style': 'error',
'array-bracket-spacing': ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'array-bracket-spacing': [ 'error', 'always' ],
'comma-dangle': [ 'error', 'always-multiline' ],
'@typescript-eslint/comma-dangle': [ 'error', 'always-multiline' ],
'max-len': [
'error',
{
Expand All @@ -50,9 +50,9 @@ module.exports = {
ignoreTemplateLiterals: true,
},
],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1, maxBOF: 0 }],
'@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: false }],
curly: ['error', 'all'],
'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 1, maxBOF: 0 } ],
'@typescript-eslint/brace-style': [ 'error', '1tbs', { allowSingleLine: false } ],
curly: [ 'error', 'all' ],
'key-spacing': 'error',

// -- Typescript
Expand All @@ -71,7 +71,7 @@ module.exports = {

overrides: [
{
files: ['src/**/*.spec.ts', 'src/**/*.spec.tsx'],
files: [ 'src/**/*.spec.ts', 'src/**/*.spec.tsx' ],
rules: {
'max-len': 'off',
},
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: [
'eslint-config-airbnb-typescript/base',
'./base.js'
'./base.js',
],
}
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"url": "https://github.com/loveholidays/eslint-config-loveholidays/issues"
},
"scripts": {
"lint": "eslint --ext .ts,.tsx ./test",
"lint": "eslint --cache .",
"lint:fix": "eslint --cache --fix .",
"lint:info": "eslint --print-config .eslintrc.js"
},
"dependencies": {
Expand Down
12 changes: 6 additions & 6 deletions react.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ module.exports = {
'plugin:react-hooks/recommended',
'./base.js',
],
plugins: ['@studysync/persnickety'],
plugins: [ '@studysync/persnickety' ],
settings: {
react: {
version: '16.2',
},
},
rules: {
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'always' }],
'react/jsx-indent': ['error', 2, { checkAttributes: true, indentLogicalExpressions: true }],
'react/jsx-curly-spacing': ['error', 'never'],
'react/jsx-fragments': ['error', 'element'],
'react/jsx-first-prop-new-line': [ 'error', 'multiline' ],
'react/jsx-max-props-per-line': [ 'error', { maximum: 1, when: 'always' } ],
'react/jsx-indent': [ 'error', 2, { checkAttributes: true, indentLogicalExpressions: true } ],
'react/jsx-curly-spacing': [ 'error', 'never' ],
'react/jsx-fragments': [ 'error', 'element' ],
'react/jsx-key': 'error',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
Expand Down
34 changes: 12 additions & 22 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
{
"include": [".*/**/.js", "**/*.js", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"jsx": "react",
"module": "esnext",
"target": "es2019",
"moduleResolution": "node",
"strict": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"sourceMap": true,
"declaration": true,
"declarationDir": "dist/types",
"esModuleInterop": true,
"skipLibCheck": true,
"baseUrl": "./test",

"jsx": "react",
"allowJs": true,

"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"outDir":"dist",
},
"typeRoots": [
"node_modules/@types",
],
"include": [
"test/**/*.ts",
"test/**/*.tsx",
],
"exclude": [
"node_modules",
]
"skipLibCheck": true,

"strict": true,
"noImplicitReturns": true,
"noUnusedLocals": true
}
}

0 comments on commit a0cfd2c

Please sign in to comment.