Skip to content

Commit

Permalink
run prettier rules to pass linting
Browse files Browse the repository at this point in the history
  • Loading branch information
p3t3r67x0 committed Oct 2, 2023
1 parent a3de086 commit c57d50b
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 142 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rules:

indent:
- error
- 4
- 2

key-spacing:
- error
Expand Down Expand Up @@ -243,4 +243,4 @@ rules:
- as-needed

consistent-return: error
default-case-last: error
default-case-last: error
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* text=auto

# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=crlf
*.* text eol=lf

# Windows forced line-endings
/.idea/* text eol=crlf
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
dist/

# Ignore HTML formatting as the diffs are not great
*.html
tailwind.config.js

# Ignore third party JavaScript
node_modules/
9 changes: 5 additions & 4 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
semi: false
singleQuote: true
bracketSameLine: true
htmlWhitespaceSensitivity: 'css'
singleAttributePerLine: false
trailingComma: 'es5'
arrowParens: 'always'
endOfLine: 'crlf'
htmlWhitespaceSensitivity: css
trailingComma: none
arrowParens: always

endOfLine: lf

overrides:
- files:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"start": "parcel serve --no-cache",
"build": "parcel build --public-url '.' --no-cache",
"htmlhint": "htmlhint \"**/*.html\" --ignore \"dist/**/*.html\" --format unix",
"lint:js": "pnpm exec eslint src && pnpm exec prettier --check \"**/*.js\"",
"prettier": "npm:@yuhr/prettier",
"lint:js": "pnpm exec eslint src",
"lint:html": "pnpm run htmlhint && pnpm exec prettier --check \"**/*.html\"",
"lint:css": "pnpm exec stylelint \"**/*.css\" && pnpm exec prettier --check \"**/*.css\"",
"lint": "pnpm run lint:js && pnpm run lint:css && pnpm run lint:html"
Expand All @@ -21,12 +22,12 @@
},
"devDependencies": {
"@parcel/config-default": "^2.9.3",
"@yuhr/prettier": "^2.8.7",
"eslint": "8.50.0",
"htmlhint": "^1.1.4",
"parcel": "latest",
"parcel-reporter-static-files-copy": "^1.5.3",
"postcss": "^8.4.30",
"prettier": "^3.0.3",
"stylelint": "^15.10.3",
"stylelint-config-standard": "^34.0.0",
"tailwindcss": "^3.3.3"
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ export default class App extends Controller {

if (this.districtId === null) {
this.model.setDistrictId(id)
} else {
}
else {
this.model.setDistrictId(this.districtId)
}

if (this.data === null) {
this.fetchData(url)
} else {
}
else {
// this.state.onDataChanged(this.data)
}
}
}
}
2 changes: 1 addition & 1 deletion src/appModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export default class AppModel extends Model {
this.setStorage('districtObject', items[0])
}
}
}
}
2 changes: 1 addition & 1 deletion src/districtSelectComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export default class DistrictSelectComponent extends Component {
handler(selectedOption - 1)
})
}
}
}
29 changes: 15 additions & 14 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<!DOCTYPE html>
<html lang="de">
<head>
<base href="./">
<meta charset="utf-8">
<head>
<base href="./" />
<meta charset="utf-8" />
<title>Sozialatlas Dashboard - Stadt Flensburg</title>
<meta content="Stastische Daten des Sozialatlas 2022 der Stadt Flensburg" name="description">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<meta
content="Stastische Daten des Sozialatlas 2022 der Stadt Flensburg"
name="description" />
<meta
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
name="viewport" />
<!--script src="https://cdn.tailwindcss.com"></script-->
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="main.css" />
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
</head>

<body>

<div id="root">
</div>
<body>
<div id="root"></div>

<script type="module" src="main.js"></script>

</body>
</html>
</body>
</html>
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export {
TestComponent,
DistrictSelectComponent,
PopComponent,
StateController,
}
StateController
}
2 changes: 1 addition & 1 deletion src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ body {
.xyz_popPercentage {
font-size: 0.8em;
padding: 8px 0;
}
}
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
Router,
Controller,
Component,
GridComponent,
GridComponent
} from '@sndcds/mvc'
import {
App,
AppModel,
TestComponent,
DistrictSelectComponent,
PopComponent,
StateController,
StateController
} from './index.js'

// Create an instance of AppModel
Expand All @@ -33,7 +33,7 @@ const demoController1 = () => {

// Create an object that maps controller names to controller functions.
const controllers = {
demoController1,
demoController1
}

// Create an instance of Router
Expand All @@ -44,4 +44,4 @@ router.start()
app.buildView('root')

// Initialize the application with url and district id
app.initApp('./details.json', 13)
app.initApp('./details.json', 13)
2 changes: 1 addition & 1 deletion src/popComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ export default class PopComponent extends Component {
setProperties(data) {
this.e.children.item(1).innerText = data.value
}
}
}
26 changes: 13 additions & 13 deletions src/stateController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class StateController {

const d = {
data: this.app.model.data,
districtId: this.app.model.districtId,
districtId: this.app.model.districtId
}
this.app.setProperties('districtSelect', d)
const c = this.app.componentById('districtSelect')
Expand Down Expand Up @@ -56,7 +56,7 @@ export default class StateController {
'65 - 80',
'80+',
'0 - 8',
'60+',
'60+'
]
new PopComponent(container2, `ageView${i}`, {
classPrefix: 'xyz',
Expand All @@ -65,7 +65,7 @@ export default class StateController {
percentage: 87.3,
barOffset: 13.2,
barColor1: '#d1e4fd',
barColor2: '#0069f6',
barColor2: '#0069f6'
})
}
}
Expand All @@ -74,36 +74,36 @@ export default class StateController {
const items = [
{
id: 'ageView1',
path: ['district_detail', '2021', 'age_groups', 'age_to_under_18'],
path: ['district_detail', '2021', 'age_groups', 'age_to_under_18']
},
{
id: 'ageView2',
path: ['district_detail', '2021', 'age_groups', 'age_18_to_under_30'],
path: ['district_detail', '2021', 'age_groups', 'age_18_to_under_30']
},
{
id: 'ageView3',
path: ['district_detail', '2021', 'age_groups', 'age_30_to_under_45'],
path: ['district_detail', '2021', 'age_groups', 'age_30_to_under_45']
},
{
id: 'ageView4',
path: ['district_detail', '2021', 'age_groups', 'age_45_to_under_65'],
path: ['district_detail', '2021', 'age_groups', 'age_45_to_under_65']
},
{
id: 'ageView5',
path: ['district_detail', '2021', 'age_groups', 'age_65_to_under_80'],
path: ['district_detail', '2021', 'age_groups', 'age_65_to_under_80']
},
{
id: 'ageView6',
path: ['district_detail', '2021', 'age_groups', 'age_80_and_above'],
path: ['district_detail', '2021', 'age_groups', 'age_80_and_above']
},
{
id: 'ageView7',
path: ['district_detail', '2021', 'age_groups', 'age_0_to_under_7'],
path: ['district_detail', '2021', 'age_groups', 'age_0_to_under_7']
},
{
id: 'ageView8',
path: ['district_detail', '2021', 'age_groups', 'age_60_and_above'],
},
path: ['district_detail', '2021', 'age_groups', 'age_60_and_above']
}
]

items.forEach((item) => {
Expand All @@ -119,4 +119,4 @@ export default class StateController {
renderDistrictSelect() {
new DistrictSelectComponent()
}
}
}
2 changes: 1 addition & 1 deletion src/testcomponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export default class TestComponent extends Component {
this.parent.e.appendChild(this.e)
this.buildChilds()
}
}
}
6 changes: 3 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module.exports = {
content: ['./src/**/*.{html,js}'],
theme: {
extend: {},
extend: {}
},
plugins: [],
}
plugins: []
}
2 changes: 1 addition & 1 deletion temporary/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ body {
canvas {
width: 100% !important;
height: 100% !important;
}
}
Loading

0 comments on commit c57d50b

Please sign in to comment.