Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning chapter 15: Router Product List #235

Open
Horki opened this issue Apr 10, 2022 · 0 comments
Open

Fix warning chapter 15: Router Product List #235

Horki opened this issue Apr 10, 2022 · 0 comments

Comments

@Horki
Copy link

Horki commented Apr 10, 2022

Warnings now

`WARNING in ~/router-product-list/src/product.ts
5:4 trailing whitespace
3 | title: string;
4 | price: number;

5 | }
| ^
WARNING in ~/router-product-list/src/product.ts
5:6 file should end with a newline
3 | title: string;
4 | price: number;
5 | }
| ^
WARNING in ~/router-product-list/src/views/Home.vue
39:3 The class property 'products' must be marked either 'private', 'public', or 'protected'
37 | export default class Home extends Vue {
38 |
39 | products: Product[]=[];
| ^
40 |
41 | selectedProduct: Product | null= null;
42 |
WARNING in ~/router-product-list/src/views/Home.vue
39:22 missing whitespace
37 | export default class Home extends Vue {
38 |
39 | products: Product[]=[];
| ^
40 |
41 | selectedProduct: Product | null= null;
42 |
WARNING in ~/router-product-list/src/views/Home.vue
39:23 missing whitespace
37 | export default class Home extends Vue {
38 |
39 | products: Product[]=[];
| ^
40 |
41 | selectedProduct: Product | null= null;
42 |
WARNING in ~/router-product-list/src/views/Home.vue
41:3 The class property 'selectedProduct' must be marked either 'private', 'public', or 'protected'
39 | products: Product[]=[];
40 |
41 | selectedProduct: Product | null= null;
| ^
42 |
43 | created() {
44 | fetch("/products.json")
WARNING in ~/router-product-list/src/views/Home.vue
41:34 missing whitespace
39 | products: Product[]=[];
40 |
41 | selectedProduct: Product | null= null;
| ^
42 |
43 | created() {
44 | fetch("/products.json")
WARNING in ~/router-product-list/src/views/Home.vue
43:3 The class method 'created' must be marked either 'private', 'public', or 'protected'
41 | selectedProduct: Product | null= null;
42 |
43 | created() {
| ^
44 | fetch("/products.json")
45 | .then(response => response.json())
46 | .then(json => {
WARNING in ~/router-product-list/src/views/Home.vue
44:11 " should be '
42 |
43 | created() {
44 | fetch("/products.json")
| ^
45 | .then(response => response.json())
46 | .then(json => {
47 | this.products=json;
WARNING in ~/router-product-list/src/views/Home.vue
45:11 Parentheses are required around the parameters of an arrow function definition
43 | created() {
44 | fetch("/products.json")
45 | .then(response => response.json())
| ^
46 | .then(json => {
47 | this.products=json;
48 | },
WARNING in ~/router-product-list/src/views/Home.vue
46:11 Parentheses are required around the parameters of an arrow function definition
44 | fetch("/products.json")
45 | .then(response => response.json())
46 | .then(json => {
| ^
47 | this.products=json;
48 | },
49 | (error) => {
WARNING in ~/router-product-list/src/views/Home.vue
47:20 missing whitespace
45 | .then(response => response.json())
46 | .then(json => {
47 | this.products=json;
| ^
48 | },
49 | (error) => {
50 | console.log('Error loading products.json:', error);
WARNING in ~/router-product-list/src/views/Home.vue
47:21 missing whitespace
45 | .then(response => response.json())
46 | .then(json => {
47 | this.products=json;
| ^
48 | },
49 | (error) => {
50 | console.log('Error loading products.json:', error);
WARNING in ~/router-product-list/src/views/Home.vue
50:8 Calls to 'console.log' are not allowed.
48 | },
49 | (error) => {
50 | console.log('Error loading products.json:', error);
| ^
51 | });
52 | }
53 |
No type errors found
Version: typescript 3.9.10, tslint 5.20.1`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant