Skip to content

Commit

Permalink
Merge pull request #6 from Bear29ers/feature/#1_update_eslint_prettie…
Browse files Browse the repository at this point in the history
…r_settings

Feature/#1 Add eslint and prettier settings(ESLintとPrettierの設定を追加)
  • Loading branch information
Bear29ers committed Jun 23, 2023
2 parents 46d0fb6 + 7ed241f commit 28a924f
Show file tree
Hide file tree
Showing 9 changed files with 1,194 additions and 9 deletions.
74 changes: 74 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */

const config = {
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
'airbnb',
'plugin:@typescript-eslint/recommended',
'next/core-web-vitals',
'plugin:import/typescript',
'plugin:react/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'unused-imports'],
rules: {
'no-unused-vars': 'off',
'arrow-body-style': 'off',
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message: 'DO NOT DECLARE ENUM',
},
],
'unused-imports/no-unused-imports': 'error',
'import/prefer-default-export': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
'react/jsx-props-no-spreading': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': false,
'ts-nocheck': false,
'ts-check': false,
},
],
},
};

module.exports = config;
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.13.0
32 changes: 32 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** @type {import('pretteir').Options} */

const config = {
printWidth: 120,
tabWidth: 2,
semi: true,
singleQuote: true,
jsxSingleQuote: true,
bracketSameLine: true,
trailingComma: 'es5',
importOrder: [
'^(react/(.*)$)|^(react$)',
'^(next/(.*)$)|^(next$)',
'<THIRD_PARTY_MODULES>',
'',
'^types$',
'^@local/(.*)$',
'^@/config/(.*)$',
'^@/lib/(.*)$',
'^@/components/(.*)$',
'^@/styles/(.*)$',
'^[./]',
],
importOrderSeparation: false,
importOrderSortSpecifiers: true,
importOrderBuiltinModulesToTop: true,
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderMergeDuplicateImports: true,
importOrderCombineTypeAndValueImports: true,
};

module.exports = config;
6 changes: 6 additions & 0 deletions next.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig =
{};

module.exports =
nextConfig;
4 changes: 0 additions & 4 deletions next.config.js

This file was deleted.

Loading

0 comments on commit 28a924f

Please sign in to comment.