Skip to content

Commit

Permalink
Added eslint rules to js files
Browse files Browse the repository at this point in the history
  • Loading branch information
silversonicaxel committed Oct 22, 2024
1 parent f775cc6 commit e491b0f
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 91 deletions.
33 changes: 17 additions & 16 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import js from '@eslint/js'
import globals from 'globals'
import importPlugin from 'eslint-plugin-import'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import importPlugin from 'eslint-plugin-import'


export default tseslint.config(
{
Expand All @@ -18,7 +19,7 @@ export default tseslint.config(
...tseslint.configs.stylisticTypeChecked,
importPlugin.flatConfigs.recommended,
],
files: ['**/*.{ts,tsx}'], // to add .js
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
Expand Down Expand Up @@ -47,16 +48,16 @@ export default tseslint.config(
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
"@typescript-eslint/no-unused-vars": [
"error",
'@typescript-eslint/no-unused-vars': [
'error',
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
'args': 'all',
'argsIgnorePattern': '^_',
'caughtErrors': 'all',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true
}
],
'@typescript-eslint/unbound-method': 'off',
Expand All @@ -82,12 +83,12 @@ export default tseslint.config(
'ignoreUrls': true
}
],
"no-trailing-spaces": "error",
"no-unused-vars": "off",
'quotes': ["error", "single"],
'no-trailing-spaces': 'error',
'no-unused-vars': 'off',
'quotes': ['error', 'single'],
'react/prop-types': 'off',
'react-refresh/only-export-components': 'off',
"semi": ["error", "never"],
'semi': ['error', 'never'],
},
settings: { react: { version: '18.3' } },
},
Expand Down
150 changes: 75 additions & 75 deletions scripts/mongo-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,115 +9,115 @@ db.createUser(

db.createCollection('ua-quotes')
db['ua-quotes'].insert({
message: "This is a sample quote",
author: "Author Name"
message: 'This is a sample quote',
author: 'Author Name'
})

db.createCollection('ua-places')
db['ua-places'].insertMany([
{
id: "1",
name: "Place 1",
address: "Address 1",
site: "https://example.com/place1",
iso: "NL",
city: "Amsterdam"
id: '1',
name: 'Place 1',
address: 'Address 1',
site: 'https://example.com/place1',
iso: 'NL',
city: 'Amsterdam'
},
{
id: "2",
name: "Place 2",
address: "Address 2",
iso: "DE",
city: "Berlin"
id: '2',
name: 'Place 2',
address: 'Address 2',
iso: 'DE',
city: 'Berlin'
},
{
id: "3",
name: "Place 3",
address: "Address 3",
iso: "IT",
city: "Milan"
id: '3',
name: 'Place 3',
address: 'Address 3',
iso: 'IT',
city: 'Milan'
},
{
id: "4",
name: "Place 4",
address: "Address 4",
site: "https://example.com/place4",
iso: "NL",
city: "Rotterdam"
id: '4',
name: 'Place 4',
address: 'Address 4',
site: 'https://example.com/place4',
iso: 'NL',
city: 'Rotterdam'
},
{
id: "5",
name: "Place 5",
address: "Address 5",
iso: "DE",
city: "Berlin"
id: '5',
name: 'Place 5',
address: 'Address 5',
iso: 'DE',
city: 'Berlin'
},
{
id: "6",
name: "Place 6",
address: "Address 6",
iso: "IT",
city: "Reggio Emilia"
id: '6',
name: 'Place 6',
address: 'Address 6',
iso: 'IT',
city: 'Reggio Emilia'
},
{
id: "7",
name: "Place 7",
address: "Address 7",
site: "https://example.com/place7",
iso: "NL",
city: "Amsterdam"
id: '7',
name: 'Place 7',
address: 'Address 7',
site: 'https://example.com/place7',
iso: 'NL',
city: 'Amsterdam'
},
{
id: "8",
name: "Place 8",
address: "Address 8",
iso: "DE",
city: "Berlin"
id: '8',
name: 'Place 8',
address: 'Address 8',
iso: 'DE',
city: 'Berlin'
},
{
id: "9",
name: "Place 9",
address: "Address 9",
iso: "IT",
city: "Milan"
id: '9',
name: 'Place 9',
address: 'Address 9',
iso: 'IT',
city: 'Milan'
},
{
id: "10",
name: "Place 10",
address: "Address 10",
site: "https://example.com/place10",
iso: "NL",
city: "Amsterdam"
id: '10',
name: 'Place 10',
address: 'Address 10',
site: 'https://example.com/place10',
iso: 'NL',
city: 'Amsterdam'
},
{
id: "11",
name: "Place 11",
address: "Address 11",
site: "https://example.com/place11",
iso: "NL",
city: "Amsterdam"
id: '11',
name: 'Place 11',
address: 'Address 11',
site: 'https://example.com/place11',
iso: 'NL',
city: 'Amsterdam'
},
{
id: "12",
name: "Place 12",
address: "Address 12",
iso: "DE",
city: "Berlin"
id: '12',
name: 'Place 12',
address: 'Address 12',
iso: 'DE',
city: 'Berlin'
},
{
id: "13",
name: "Place 13",
address: "Address 13",
iso: "IT",
city: "Reggio Emilia"
id: '13',
name: 'Place 13',
address: 'Address 13',
iso: 'IT',
city: 'Reggio Emilia'
}
])

db.createCollection('ua-isos')
db['ua-isos'].insert([
{
DE: "Germany",
IT: "Italy",
NL: "Netherlands"
DE: 'Germany',
IT: 'Italy',
NL: 'Netherlands'
}
])
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
},
"exclude": ["node_modules"],
"include": [
"scripts/",
".next/types/**/*.ts",
"eslint.config.js",
"next-env.d.ts",
"next.config.mjs",
"vitest.setup.mts",
Expand Down

0 comments on commit e491b0f

Please sign in to comment.